Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-16-2012, 04:10 PM   PM User | #1
fulltiltphil
New Coder

 
Join Date: Mar 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
fulltiltphil is an unknown quantity at this point
Arrow Javascript not workin in Firefox or Chrome

This is a JavaScript sample that works with Internet Explorer and Safari, but not with FireFox and Chrome. If you take the code and save it as test.html open the file with explorer or Safari you will see it works. This is the first time of posted on this forum, sorry if I missed any information. This form posts to a InternetSecure(payment gateway) Sandbox account.

[CODE]
<head>

<title>Variable Payment - JavaScript</title>

</head>

<script language="javascript">

function getamount()

{

prod = "::1::P001::Sample Payment::";

pvalue = document.getElementsByName("payvalue")(0).value;

amount = pvalue + prod;

document.frmdo.Products.value = amount;

}

</script>



<body>



<table align="center" width="600">

<tr>

<td align="center" valign="middle"><big>View Source For HTML Code<br></big><em><strong>Variable Payment - JavaScript</strong></em><br /></td>

</tr>

</table>



<td align="center" valign="top">



<FORM method=post name="frmdo" action="https://test.internetsecure.com/process.cgi" onsubmit="return getamount();">

<input type="hidden" name="GatewayID" value="106" />

<input type="hidden" name="ReturnURL" value="https://testwww.internetsecure.com/merchants/Demopage.asp?page=THK2" />

<input type="hidden" value="https://testwww.internetsecure.com/merchants/Demopage.asp?page=SAM1" name="xxxCancelURL" />

<input type="hidden" name="Products" value="" />



<table align="center" width="600">

<tr>

<td width="300" height="100%" align="right" valign="middle"><font face="Arial, Helvetica, sans-serif" size="2" color="Black">Invoice Number</font></td>

<td width="300" height="100%" align="left" valign="middle"><input type="text" id="Invoice Number" name="xxxMerchantInvoiceNumber" size="8" /></td>

</tr>



<tr>

<td width="300" height="100%" align="right" valign="Middle"><font face="Arial, Helvetica, sans-serif" size="2" color="Black">Payment Amount $</font></td>

<td width="300" height="100%" align="left" valign="middle"><input type="text" name="payvalue" value="" size=10 style="text-align:right;" />

<font face="Arial, Helvetica, sans-serif" size="2" color="Black"> USD</font></td>

</tr>

</table>



<table align="center" width="600">

<tr>

<td width="600" height="100%" align="center" valign="middle"><input type="submit" value="Submit Payment" name="submit" /></td>

</tr>

</table>



<table align="center" width="600">

<tr>

<td width="600" height="100%" align="center" valign="middle">

<!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/visa04.gif" WIDTH=37 HEIGHT=23>

<!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/mc04.gif" WIDTH=37 HEIGHT=23>

<!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/amex04.gif" WIDTH=37 HEIGHT=23>

<!-- Copy this Grahpic to your Host and change the URL to point to your server --><IMG ALIGN=CENTER SRC="https://secure.internetsecure.com/images/disc04.gif" WIDTH=37 HEIGHT=23>

</td>

</tr>

</table>

<table align="center" width="600">

<tr>

<td width="600" height="100%" align="center" valign="middle"><a target="_blank" href="https://testwww.internetsecure.com/cgi-bin/certified.mhtml?merchant_number=106"><img height="33" border="0" align="center" width="98" alt="" src="https://testwww.internetsecure.com/images/ismerch_sm.gif" /></a></td>

</tr>

</table>

</form>
[CODE]
fulltiltphil is offline   Reply With Quote
Old 03-16-2012, 04:54 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,032
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Change the script to:-

Code:
<script type = "text/javascript">

function getamount(){
var prod = "::1::P001::Sample Payment::";
var pvalue = document.frmdo.payvalue.value;
var amount = pvalue + prod;
document.frmdo.Products.value = amount;
}

</script>

"That which seems the height of absurdity in one generation often becomes the height of wisdom in the next". - John Stuart Mill.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 03-16-2012 at 05:00 PM..
Philip M is offline   Reply With Quote
Old 03-16-2012, 05:32 PM   PM User | #3
fulltiltphil
New Coder

 
Join Date: Mar 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
fulltiltphil is an unknown quantity at this point
That worked! Thank you!
fulltiltphil is offline   Reply With Quote
Reply

Bookmarks

Tags
chrome, firefox, internetsecure, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:14 AM.


Advertisement
Log in to turn off these ads.