Entry
i want to retain values of a hidden form field on page refresh in html using javascript alone
Oct 8th, 2003 18:06
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