Home All Groups Group Topic Archive Search About

Setting control value in Javascript

Author
11 Jul 2005 11:02 AM
Mantorok
Hi

When I use JS to set a value of, say, a textbox how can I have that value
posted back?

When my code-behind runs I cannot see a way of identifying the value
populated by the JS.

Thanks
Kev

Author
12 Jul 2005 2:54 PM
Teemu Keiski
Hi,

how does it matter by which (user or JS) the input has been changed? You
still get the input via TextBox's Text property as long as the TextBox
itself is server-side control.

If you need to identify by which one the input was made, you can populate
separate, server-side, hidden INPUT field which you could read on postback
so that it indicates which one, user or JS code, made the change to the data
(js code could change its value at the same time when it changes TextBox's
text).

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
Author
19 Jul 2005 9:52 AM
Mantorok
"Teemu Keiski" <jot***@aspalliance.com> wrote in message
news:OztDcGvhFHA.1464@TK2MSFTNGP14.phx.gbl...
> Hi,

> If you need to identify by which one the input was made, you can populate
> separate, server-side, hidden INPUT field which you could read on postback
> so that it indicates which one, user or JS code, made the change to the
> data (js code could change its value at the same time when it changes
> TextBox's text).

That's what I did in the end, thanks.

Kev