J
JCCDevel
Hi All,
I'm not too proficient in Javascript but am trying to help a friend
out. Bascially, the page we are having trouble with is loaded with a
numerical value in the url string. Example:
http://www.webpage.com/v4/payment_pg.php?FeeCalcTotalDecimal =49.50
I then parse the string to get the total. I then want to assign the
value to a hidden form value
(document.form1.FeeCalcTotalDecimal.value) The hidden value is to be
used to post to a bank's website.
I'm sure this is just a syntax issue, but I'm stumped. Keep getting
"document.form1.FeeCalcTotalDecimal.value is null or not an object."
<CODE>
<script language="JavaScript">
function parseGetVars() {
var getVars = new Array();
var qString = unescape(top.location.search.substring(1));
var pairs = qString.split(/\&/);
for (var i in pairs) {
var nameVal = pairs.split(/\=/);
getVars[nameVal[0]] = nameVal[1];
}
return getVars;
}
</script>
<script>
var g = parseGetVars();
for (var i in g)
document.writeln('Your total fee is $' +g+'<br>');
document.form1.FeeCalcTotalDecimal.value = '+g+' ; THIS ISN'T
WORKING!!
</script>
<br />
</font> </div>
<table width="715" height="52" border="0">
<tr>
<td align="center" width="374" height="48"> <form
name="form1" method="post" action="https://secure.linkpt.net/lpcentral/
servlet/lppay">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="storename" value="1001184858">
<INPUT type="hidden" name="chargetotal"
value="FeeCalcTotalDecimal">
<input type="hidden" name="suppressTitle" value="true">
<input name="Submit" type="submit" id="Submit" value="Submit">
</td>
<td width="331">
</div>
</form></td>
</tr>
</table>
</CODE>
Thanks in advance for your help!
JCC
I'm not too proficient in Javascript but am trying to help a friend
out. Bascially, the page we are having trouble with is loaded with a
numerical value in the url string. Example:
http://www.webpage.com/v4/payment_pg.php?FeeCalcTotalDecimal =49.50
I then parse the string to get the total. I then want to assign the
value to a hidden form value
(document.form1.FeeCalcTotalDecimal.value) The hidden value is to be
used to post to a bank's website.
I'm sure this is just a syntax issue, but I'm stumped. Keep getting
"document.form1.FeeCalcTotalDecimal.value is null or not an object."
<CODE>
<script language="JavaScript">
function parseGetVars() {
var getVars = new Array();
var qString = unescape(top.location.search.substring(1));
var pairs = qString.split(/\&/);
for (var i in pairs) {
var nameVal = pairs.split(/\=/);
getVars[nameVal[0]] = nameVal[1];
}
return getVars;
}
</script>
<script>
var g = parseGetVars();
for (var i in g)
document.writeln('Your total fee is $' +g+'<br>');
document.form1.FeeCalcTotalDecimal.value = '+g+' ; THIS ISN'T
WORKING!!
</script>
<br />
</font> </div>
<table width="715" height="52" border="0">
<tr>
<td align="center" width="374" height="48"> <form
name="form1" method="post" action="https://secure.linkpt.net/lpcentral/
servlet/lppay">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="storename" value="1001184858">
<INPUT type="hidden" name="chargetotal"
value="FeeCalcTotalDecimal">
<input type="hidden" name="suppressTitle" value="true">
<input name="Submit" type="submit" id="Submit" value="Submit">
</td>
<td width="331">
</div>
</form></td>
</tr>
</table>
</CODE>
Thanks in advance for your help!
JCC