Setting control value in Javascript

Discussion in 'ASP .Net Web Controls' started by Mantorok, Jul 11, 2005.

  1. Mantorok

    Mantorok Guest

    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
     
    Mantorok, Jul 11, 2005
    #1
    1. Advertising

  2. Mantorok

    Teemu Keiski Guest

    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
     
    Teemu Keiski, Jul 12, 2005
    #2
    1. Advertising

  3. Mantorok

    Mantorok Guest

    "Teemu Keiski" <> wrote in message
    news:...
    > 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
     
    Mantorok, Jul 19, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mantorok
    Replies:
    2
    Views:
    570
    =?Utf-8?B?TmlybWFs?=
    Jul 11, 2005
  2. -
    Replies:
    0
    Views:
    335
  3. Replies:
    1
    Views:
    718
  4. =?Utf-8?B?ZGF2aWQ=?=

    JavaScript assigns a value to label control text value?

    =?Utf-8?B?ZGF2aWQ=?=, May 24, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    23,990
    =?Utf-8?B?ZGF2aWQ=?=
    May 26, 2006
  5. avcitamer
    Replies:
    6
    Views:
    226
    Bob Barrows [MVP]
    Sep 18, 2008
Loading...

Share This Page