Forum Moderators: open

Message Too Old, No Replies

ASP.NET capture Client-side textbox value

         

letsgetsilly

11:26 am on Mar 27, 2007 (gmt 0)

10+ Year Member



I'm running ASP.NET 2.0 web application. I have 2 text boxes, A and B. A is enabled and the B is disabled. B's value is set by the following working javascript to equal 100-A's value:

document.getElementById("B").value = 100-ValueOfA;

I'm unable to use the code behind to grab this value after a postback, and I'm curious as to why not. The textboxes are within the ASP.NET 2.0 Wizard control, which renames the clientside ID's. However, other text boxes I'm able to get the value for that are also in the wizard.

I'm also using an AJAX panel to capture postback.

Fotiman

2:42 pm on Mar 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Disabled inputs do not get submitted. See the spec:
[w3.org...]
[w3.org...]

Instead, try making it readonly. This will still prevent the user from directly modifying it, but it can now be submitted.