1. The only things that you can pass between web sites are string values.

2. The other web site has to give you the names of the values that they will accept.

3. This passes values to PayPal.
1. Add each hidden variable needed as follows:

<input type=”hidden” id=”OrderID” runat=”server”>
2. The button that will submit values to the external site:

<input type=”button” onclick=”javascript: submitToPayPal(‘http://www.paypal.com/cgi-bin/webscr’);” value=”Submit to PayPal” >
3. Add the necessary JavaScript to the page:

<script type=”text/javascript”><!–function submitToPayPal(formAction){ var formElementsArray = document.getElementsByTagName(‘FORM’);   if ( formElementsArray != null )  {   var formElement = formElementsArray[0];
document.getElementById(‘__EVENTTARGET’).value = ‘ ‘;  document.getElementById(‘__EVENTARGUMENT’).value = ‘ ‘;  document.getElementById(‘__VIEWSTATE’).name = ‘NOVIEWSTATE’;
formElement.action = formAction;  formElement.submit();  }}// –>

 

</script>

Warm regards. .

Sameer

 

Advertisements