javascript and label

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form in which i am resetting the value of a label using javascript. I have another button on the form to save the record. However, when the record is saved, it is still taking the "old" value that was formerly on the form instead of the updated value that was provided using the javascript button. How do I get .net to read the lastest value on the form that is showing?
 
i can see two reasons to happen this.
first, if u r creating the server control in the page load or atleast u r
setting the value of that, u have a trouble. bcos when postback with the
button click, it will set the default value. to solve that, u have to use
"IsPostBack" in the page load event.

second, with the ViewState of the page. with the view state, it is holding
the values of the page. so it may be resetting the value again when refresh.
u can use a hidden server control and set the value there also when change
the lable. so u can access that value in the button click ivent u need.

hope this helps,
CMA


bob d said:
I have a form in which i am resetting the value of a label using
javascript. I have another button on the form to save the record. However,
when the record is saved, it is still taking the "old" value that was
formerly on the form instead of the updated value that was provided using
the javascript button. How do I get .net to read the lastest value on the
form that is showing?
 
only form fields are posted back, labels are not, so the server can no
changes done to the label. use a hidden field to pass the data.

-- bruce (sqlqwork.com)


bob d said:
I have a form in which i am resetting the value of a label using
javascript. I have another button on the form to save the record. However,
when the record is saved, it is still taking the "old" value that was
formerly on the form instead of the updated value that was provided using
the javascript button. How do I get .net to read the lastest value on the
form that is showing?
 
Back
Top