faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 23 people (35%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

i want to retain values of a hidden form field on page refresh in html using javascript alone

Apr 5th, 2008 20:35
ha mo, Fred Jounters, gaya sri,


If I understand You right, You could read out the hidden input-field 
with regular javascript, construct the new url to look like this
http://some.foo/myform.html?hiddenval=value 
and make this the refresh-url. Then, simply read out the 
window.location.search var and split it to your needs. For more than one 
var, use ...html?var1=thisisone&var2=somethin&......
Also: If the value of the var contains any special chars, use encodeUri 
and decodeUri !
<script type="text/javascript">
<!--//
if(window.location.search != "")
 alert(window.location.search);
//-->
</script>
Hope this helped,
Fred
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com