Need help with POST code

NPUser

Registered User.
Local time
Yesterday, 19:53
Joined
Jul 25, 2004
Messages
55
I have following code to post the variables to a online payment processing URL. Following code works great but the problem is Payment processing company want us to use two URLS - one for Credit card and other for Checks.

Difference between tow URLS - besides URL a payment indicator "PMT_INDICATOR= "C" passed to "'https://ww.somebank.com/PayPost/399/Gateway.aspx' ID="Form1">" url and ""PMT_INDICATOR= "D" is passed to "'https://ww.somebank.com/PayPost/400/Gateway.aspx' ID="Form1">". C is for credit and D is for Debit.


So all i want is a field (dropdown) is OK. If they select Credit then change PMT_INDICATOR to C and post to "'https://ww.somebank.com/PayPost/399/Gateway.aspx' ID="Form1">" or if they select Check then change PMT_INDICATOR to D and post to "'https://ww.somebank.com/PayPost/400/Gateway.aspx' ID="Form1">" else ask them to select one.


Is this possible? Any help or quidence is higly appriciated.

sa



<form name="transfer" method="post" action='https://ww.somebank.com/PayPost/399/Gateway.aspx' ID="Form1">
<input type="hidden" Value ="Account Balance" name="PMT_TYPE_DESC" >
<input type="hidden" Value ="C" name="PMT_INDICATOR" >
<input type="hidden" Value ="2718" name="ACCOUNT" >
<td colspan="2" align="center"><input type="submit" value="Pay Now" ID="Submit1" NAME="Submit1"></td>  
</p>
</form>
 
something similar

Here is what i am trying to do.

<html>

<form name="transfer" method="post" action=' <% Response.Write( PUrl ) %> ' ID="Form1">
<input type="hidden" Value ="Account Balance" name="PMT_TYPE_DESC" >
<input type="hidden" Value ="701" name="AMOUNT_PAID" >
<input type="hidden" Value =' <% Response.Write(PMT_INDICATOR ) %>' name="PMT_INDICATOR" >
<input type="hidden" Value ="2718" name="ACCOUNT" >
<input type="hidden" Value ="ABC" name="STUDENT_LASTNAME" >
 <input type="checkbox" name="C1" value="ON">Credit Card 
<input type="checkbox" name="C2" value="ON">Check<p>

<script>
if (Checkbox.c1.selected)
{
PMT_INDICATOR = "C";
checkbox.c2.selected = "Off"
PUrl= "https://somebank.com/Pay/199/Gateway.aspx"


else if (Checkbox.c2.selected) {
PMT_INDICATOR = "S";
checkbox.c1.selected = "Off"
PUrl= "https://somebank.com/Pay/200/Gateway.aspx"

else
msgbox "Select a payment type"
return false
end if
}
</script>


<td colspan="2" align="center"><input type="submit" value="Pay Now" ID="Submit1" NAME="Submit1"></td>  
</p>
</form>


</html>
 
I have following so far. How do i change the post action URL based upon dropdown selection?


Method="POST", Action= & url

IF (dropdown.index =1)
{
url = "http://somebank.com/1/post.asp"

}

IF (dropdown.index =2)
{
url = "http://somebank.com/2/post.asp"

}


thanks
sa





<html>


<script Language="JavaScript">
<!--




function confirm_dropdown()
{
if (transfer.PMT_INDICATOR.selectedIndex == 0)
{
alert("Please select a payment type.");
transfer.PMT_INDICATOR.focus();
return (false);
}
return (true);
}



//--></script>

<form name="transfer" method="post" action= "https://somebank.com/Pay/199/Gateway.aspx" onsubmit=" return confirm_dropdown()" ID="Form1">
<input type="hidden" Value ="Account Balance" name="PMT_TYPE_DESC" >
<input type="hidden" Value ="701" name="PMT_TYPE" >
<input type="hidden" Value ="701" name="AMOUNT_PAID" >
<input type="hidden" Value ="2718" name="ACCOUNT" >
<input type="hidden" Value ="ABC" name="STUDENT_LASTNAME" >
<p>
 <select size="1" name="PMT_INDICATOR">
<option value="Select Payment Type" selected>Select Payment Type
</option>
<option value="C">Credit Card</option>
<option value="S">Check Payment</option>
</select></p>
<p> <td colspan="2" align="center"><input type="submit" value="Pay Now" ID="Submit1" NAME="Submit1"></td>  
</p>
</form>



</html>
 

Users who are viewing this thread

Back
Top Bottom