I've been struggling with the below piece of code. it works in ie, but not in firefox..
I had to pass a piped string that carries the parameters to another gateway.. one of these was to be a randomized order id. hence the rand procedure.
then the concatenation in the getinfo() function
This code throws two errors on the firefox error console.
Error: document.getElementById("requestparameter") is null
Error: document.ecom.submit is not a function
Any help would be greatly appreciated. Also, if someone can suggest someway to concat the multi variables I need to pass as a piped string in the following line -
input type="hidden" name="requestparameter" value="val1|val2|val3|val4"
it'd be great.
thanks
CODE here
Expand|Select|Wrap|Line Numbers
- <head>
- <script type="text/javascript">
- var rannum1;
- rannum1 = Math.random()*10000000;
- rannum = Math.round(rannum1);
- </script>
- <script>
- //this function will get the variables and pass them to the hidden form fields
- function getinfo()
- {
- document.getElementById('requestparameter').value = ("203|DOM|IND|INR|10|"+"UBS"+rannum+"|others|http://www.url.com/success.html|http://www.url.com/fail.html|Diry")
- window.alert(requestparameter.value);
- }
- </script>
- <script src="dpEncodeRequest.js"></script>
- <script>
- function encodeTxnRequest()
- {
- document.ecom.requestparameter.value =
- encodeValue(document.ecom.requestparameter.value);
- document.ecom.submit();
- }
- </script>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- </head>
- <body onLoad="getinfo()">