Click here to Skip to main content
15,894,265 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI all,

Suppose I have one label and 1 hidden field. label is having some value and I want to assign the same value to that hidden field. My code is like this.

<asp:label id="Amount" runat="server" text="1000" xmlns:asp="#unknown"></asp:label>
<input type="hidden" name="Amount" value=""></input>


What should I write in value field to assign value to input?

I want to assign the same value as Label ie 1000

Thanks in advance.
Posted

1 solution

if you are doing from server side only then you should not be having any problem because as you are assigning to label in the same way you can assign the same to hidden variable.
First put some id in hiddenvariable Now if you are updating label from javascript then at the same you need to update the hidden variable as
document.getElementById(hiddenvariableid).value = updatedvalue
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900