Home All Groups Group Topic Archive Search About

is the value passed via HiddenField to client-side always string?

Author
17 Jun 2006 3:20 PM
André
Hi,

I want to pass a integer value to client-side via a hiddenfield created in
the aspx (HiddenField1)

dim myvalue as integer
myvalue=5
HiddenField1=myvalue

When fetching in Javascript, the value is of type string.
var myvalue=document.getElementById("HiddenField5").value

Is this by default? Do i have to parseInt each value passed?

Thanks
André

Author
17 Jun 2006 4:02 PM
Kevin Spencer
*Everything* in an HTML document is text. So, yes, you do.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

Show quoteHide quote
"André" <sd***@sds.sdf> wrote in message
news:e3xo2GikGHA.1272@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I want to pass a integer value to client-side via a hiddenfield created in
> the aspx (HiddenField1)
>
> dim myvalue as integer
> myvalue=5
> HiddenField1=myvalue
>
> When fetching in Javascript, the value is of type string.
> var myvalue=document.getElementById("HiddenField5").value
>
> Is this by default? Do i have to parseInt each value passed?
>
> Thanks
> André
>
>
Author
17 Jun 2006 7:37 PM
André
Thanks

Show quoteHide quote
"Kevin Spencer" <kevin@DIESPAMMERSDIEtakempis.com> wrote in message
news:u7fIkdikGHA.1508@TK2MSFTNGP04.phx.gbl...
> *Everything* in an HTML document is text. So, yes, you do.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> Professional Chicken Salad Alchemist
>
> I recycle.
> I send everything back to the planet it came from.
>
> "André" <sd***@sds.sdf> wrote in message
> news:e3xo2GikGHA.1272@TK2MSFTNGP03.phx.gbl...
> > Hi,
> >
> > I want to pass a integer value to client-side via a hiddenfield created
in
> > the aspx (HiddenField1)
> >
> > dim myvalue as integer
> > myvalue=5
> > HiddenField1=myvalue
> >
> > When fetching in Javascript, the value is of type string.
> > var myvalue=document.getElementById("HiddenField5").value
> >
> > Is this by default? Do i have to parseInt each value passed?
> >
> > Thanks
> > André
> >
> >
>
>