Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Setting control value in Javascript

Reply
Thread Tools

Setting control value in Javascript

 
 
Mantorok
Guest
Posts: n/a
 
      07-11-2005
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


 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      07-12-2005
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




 
Reply With Quote
 
 
 
 
Mantorok
Guest
Posts: n/a
 
      07-19-2005

"Teemu Keiski" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal value setting problem (ASP & ADODB.Recordset value & MSSQLServer & 2003 Server) avcitamer ASP General 6 09-18-2008 03:10 PM
JavaScript assigns a value to label control text value? =?Utf-8?B?ZGF2aWQ=?= ASP .Net 8 05-26-2006 04:20 PM
setting the selected value of radiobutton list from database value jwright1@mail.com ASP .Net 1 05-14-2006 01:26 AM
Setting server control value from Javascript Mantorok ASP .Net 2 07-11-2005 02:22 PM
Checking old value with new value before setting. - Java 0 06-07-2005 06:15 AM



Advertisments