I have a js function that needs to run client side and access two values from the form. I need to be able to set those values from the server in code behind.
So the flow would go like this:
user clicks a button
server gathers 2 values
values get assigned to form controls
post back
user clicks another button
clientside js function runs using the two values in the form
My problem is I don't know how to pass the values in a format that both the server and the client will like.
If I put the values in server asp textboxes then the names of the controls get changed to things like 'ctl00_myControl' and the js can't find them (using document.getElementById("myControl").value
If I put the values in html controls like
<input id="TextX" name="TextX" type="text" value="myx" />
the js can see them but I have no way of assigning new values to the controls on the server side.
Am I missing something simple here. Probably.
So the flow would go like this:
user clicks a button
server gathers 2 values
values get assigned to form controls
post back
user clicks another button
clientside js function runs using the two values in the form
My problem is I don't know how to pass the values in a format that both the server and the client will like.
If I put the values in server asp textboxes then the names of the controls get changed to things like 'ctl00_myControl' and the js can't find them (using document.getElementById("myControl").value
If I put the values in html controls like
<input id="TextX" name="TextX" type="text" value="myx" />
the js can see them but I have no way of assigning new values to the controls on the server side.
Am I missing something simple here. Probably.