473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

javascript and label

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?
Nov 18 '05 #1
2 1035
CMA
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" <an*******@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
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?
Nov 18 '05 #2
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" <an*******@discussions.microsoft.com> wrote in message
news:17**********************************@microsof t.com...
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?
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: delerious | last post by:
I see some code examples like this: <DIV onmouseover="this.style.background='blue'"> and other code examples like this: <DIV onmouseover="javascript:this.style.background='blue'"> Which...
4
by: Ike | last post by:
Oh I must be missing somethign so simple and stupid. I need to do a submit() via an href, which I do (succesfully) in JavaScript in many other pages with <a...
2
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
0
by: Keith | last post by:
I have a web form that contains a repeater control that is designed to ask like a check book register. Clicking on a certain transaction takes the user to a different .aspx page where it can be...
2
by: Phil | last post by:
Hi, There is a label and a textbox. There are two buttons: one HTML (buttonA), the other ASP.NET (ButtonB). Clicking on buttonA starts a javascript function, starting on ButtonB triggers...
11
by: nitha | last post by:
hi there...i need help... just wondering how to put a function? this is the form: <form> <p>Room type:<br/> <input type="radio" id="room1" name="room" onclick="roomCost=150"...
1
by: KRISHNA PRAVI | last post by:
the error is "runtime error object expected" here is the code....................................................................................... <script language="javascript"...
2
by: pankajsingh5k | last post by:
Dear All, Please help me... I had read an article to lazy load a tab in a tabcontainer using an update panel on http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.