Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2011
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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]

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,022
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    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.
    Last edited by Philip M; 03-16-2012 at 05:00 PM.

    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.

  • #3
    New Coder
    Join Date
    Mar 2011
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked! Thank you!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •