# Param Value Sending

**URL:** <https://forum.kirupa.com/t/param-value-sending/169798>\
**Category:** web dev\
**Created:** [November 19, 2005, 5:00pm UTC](https://forum.kirupa.com/t/param-value-sending/169798 "2005-11-19T17:00:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prego](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@Prego](https://forum.kirupa.com/u/Prego)\
**Post date:** [November 19, 2005, 5:00pm UTC](https://forum.kirupa.com/t/param-value-sending/169798/1 "2005-11-19T17:00:20Z")

</div>

How come this dosn’t work?  
Page 1:  
[SIZE=1]\<html\>

\<head\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252”\>  
\<title\>Page 1\</title\>  
\</head\>

\<body\>

\<form method=“POST” action="–WEBBOT-SELF–" name=“hardware”\>  
\<p\>\<input type=“text” name=“TOTAL” size=“20”\>\</p\>  
\<a href=“2.htm” onclick=“document.location.assign(‘2.htm?TOTAL=’ + escape(document.forms[‘hardware’][‘TOTAL’].value));return false;”\>Send to next page\</a  
\>\</form\>

\</body\>

\</html\>[/SIZE]  
Page 2:  
[SIZE=1]\<HTML\>  
\<head\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252”\>  
\<title\>Page 2\</title\>  
\<script\>  
function getParamFromURL(sParam, sDefault) {  
var sResult = getParamValue(sDefault, “”);

```
try { 
    sResult = readQueryString().item(sParam); 
} catch(e) {} 

return sResult; 

```

}  
function readQueryString()  
{  
var sSearch = document.location.search  
var oRE = /(?:?|&)([^?&]+?)=([^?&]+)/g  
var aQueryString = new Array()

```
sSearch = sSearch.replace(/%26/gi, "&"); 

while (oRE.exec(sSearch)) 
{ 
    aQueryString.add(RegExp.$1, RegExp.$2); 
} 

return aQueryString 

```

}  
function loadFields(){  
document.forms[“accessories”][“TOTAL2”].value = getParamFromURL(“TOTAL”, “”);  
}  
\</script\>  
\</head\>  
\<body onload=“loadFields()”\>  
\<form name=“accessories”\>  
\<input type=“text” name=“TOTAL2”\>  
\</form\>  
\</body\>  
\</html\>[/SIZE]  
It should send the entered value to the next page but it dosn’t. Any idea whats wrong?  
Cheers
