ASP textbox not returning client-side changed value

Discussion in 'ASP .Net' started by John, Oct 9, 2005.

  1. John

    John Guest

    Hi all,

    I've an interesting problem in that when I set my textbox enabled property
    to true and run my app and a Javascript function updates it, I can access
    the changed data server-side and it is correct. The moment I changed either
    the enabled property to false or the readonly property to true, the change
    is not reflected upon postback.

    The workaround for me is that firstly I leave the textbox as editable and in
    it's client-side "onchange", I recalc the value since the textbox in
    question is a calculated field.

    Surely there's a better way to go about this!!!???

    Regards
    John.
    John, Oct 9, 2005
    #1
    1. Advertising

  2. John

    Frankie Guest

    Hi John,

    This may not be a Better way, but it's Another way: You could have the
    Javascript function update a hidden <input> in addition to the read only
    textbox; then read hidden <input> value on PostBack.

    -HTH



    "John" <> wrote in message
    news:%...
    > Hi all,
    >
    > I've an interesting problem in that when I set my textbox enabled property
    > to true and run my app and a Javascript function updates it, I can access
    > the changed data server-side and it is correct. The moment I changed
    > either the enabled property to false or the readonly property to true, the
    > change is not reflected upon postback.
    >
    > The workaround for me is that firstly I leave the textbox as editable and
    > in it's client-side "onchange", I recalc the value since the textbox in
    > question is a calculated field.
    >
    > Surely there's a better way to go about this!!!???
    >
    > Regards
    > John.
    >
    Frankie, Oct 9, 2005
    #2
    1. Advertising

  3. John

    Darren Kopp Guest

    Maybe have javascript set the textbox to disabled rather than an attribute
    on the text box.

    -Darren Kopp
    http://blog.secudocs.com/

    "John" <> wrote in message
    news:%...
    > Hi all,
    >
    > I've an interesting problem in that when I set my textbox enabled property
    > to true and run my app and a Javascript function updates it, I can access
    > the changed data server-side and it is correct. The moment I changed
    > either the enabled property to false or the readonly property to true, the
    > change is not reflected upon postback.
    >
    > The workaround for me is that firstly I leave the textbox as editable and
    > in it's client-side "onchange", I recalc the value since the textbox in
    > question is a calculated field.
    >
    > Surely there's a better way to go about this!!!???
    >
    > Regards
    > John.
    >
    Darren Kopp, Oct 9, 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. Valerian John
    Replies:
    6
    Views:
    5,032
    Valerian John
    May 17, 2004
  2. nick
    Replies:
    3
    Views:
    3,166
    Eliyahu Goldin
    Dec 15, 2004
  3. Boss302
    Replies:
    0
    Views:
    1,021
    Boss302
    Nov 21, 2006
  4. nick
    Replies:
    1
    Views:
    204
    Victor Garcia Aprea [MVP]
    Dec 23, 2004
  5. Jack
    Replies:
    4
    Views:
    176
    Phillip Windell
    Nov 26, 2003
Loading...

Share This Page