Setting control value in Javascript

M

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
 
T

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).
 
M

Mantorok

Teemu Keiski said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top