Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
store the html textbox to html hidden field(without runat server) in javascript,
but the hidden fields display null value in asp.net...
i mention runat server in hidden fields means its working..
i want to know how to use hidden field without runat server in asp.net
Posted

Try this:
JavaScript
document.getElementById('TextboxId').value = document.getElementById('HiddenInputId').value; 

You can see below link for working example:
Working Example[^]
 
Share this answer
 
Comments
Skvignesh 9-Aug-12 5:34am    
thanks.. i know this but its working in client side, the value cant be used in server side. that's my question
Vani Kulkarni 9-Aug-12 5:55am    
Is there a problem if you use Runat="server"?
Skvignesh 9-Aug-12 7:07am    
ya.. that's y i asked without runat how to pass the value???
Server Controls required attributes like: runat="server" & ID="SomeID" So you need to use it. Without these attributes if you'll try to run the application, then application will give error at compile time. Whereas, HTML controls, depends upon you to use these attribute(Instead of ID you can use name in HTML).


--Amit
 
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