/    Sign up×
Community /Pin to ProfileBookmark

Rotating invoice number

Hi Webdeveloper members,

Just implement payment gateway system for one of my projects, unfortunately i need to change invoice number manually every time.

How i can do it automatically? Is there any script that can help me to replace it after customer make payment. This is part of form that my bank offer me.

Invoice No :<INPUT type=”text” id=INVMERCHANT name=INVMERCHANT value=”000000009999″></form><button onclick=”document.sendform.submit();”>Submit</button><!–<script>document.sendform.submit();</script>–></body>

Kind regards
Kal

Ps. Please if it is possible give me a sample code.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@mikemJan 05.2009 — Hi Kal, You could have the invoice number generated when the page loads assigning a number based on elapsed time since the epoch, with something like this...[CODE]onload=function(){ document.getElementById("INVMERCHANT").value=new Date().getTime(); }[/CODE] This would create unique numbering unless two instances of the page were loaded at the exact same millisecond. Mike ?
Copy linkTweet thisAlerts:
@banevauthorJan 05.2009 — Hi Kal, You could have the invoice number generated when the page loads assigning a number based on elapsed time since the epoch, with something like this...[CODE]onload=function(){ document.getElementById("INVMERCHANT").value=new Date().getTime(); }[/CODE] This would create unique numbering unless two instances of the page were loaded at the exact same millisecond. Mike ?[/QUOTE]

Thanks for quick reply Mike,

I am absolute newbie, and i do not have any idea where to put the code between my script:

<h2>Automatic credit card payment system provided by Kasikorn bank over secured connection.</h2>

<p><img alt="" style="width: 108px; height: 31px;" src="/files/content/images/ssl_secured.jpg" /><img height="30" width="100" alt="" src="/files/content/images/visa_mastercard_logos.jpg" /></p>

<form action="https://rt05.kasikornbank.com/pgpayment/payment.aspx" method="post" name="sendform">

<h3 style="color: Red;"><input type="hidden" value="401001213339001" name="MERCHANT2" id="MERCHANT2" /> <input type="hidden" value="70344541" name="TERM2" id="TERM2" /><strong>Enter&nbsp; Amount</strong> :<input type="text" value="" name="AMOUNT2" id="AMOUNT2" /> <input type="hidden" value="http://www.thailandholidayhomes.co.uk/" name="URL2" id="URL2" /> <input type="hidden" value="" name="RESPURL" id="RESPURL" /> <input type="hidden" value="" name="IPCUST2" id="IPCUST2" /> <input type="hidden" value="Booking Deposit" name="DETAIL2" id="DETAIL2" /> <input type="hidden" value="000000099987" name="INVMERCHANT" id="INVMERCHANT" /> (Example 660000 = 6600.00 Baht&nbsp; - six-thousand and six-hundred baht)</h3>

<p><img src="/files/content/images/attention.png" style="width: 33px; height: 27px;" alt="" /><strong>We appologize, at the moment our bank do not accept decimal values, so you need to add additional 2 zeros at the end of final amount</strong></p>

</form>

<p><button onclick="document.sendform.submit();"> Pay Now!</button></p>

<!--<script>document.sendform.submit();</script>-->

I put a code, and i got error message, value must be digits! Please help me to fix this issue

Kind regards

Kal
Copy linkTweet thisAlerts:
@mikemJan 05.2009 — Hi Kal, As an example... [code=html]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<meta http=equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title>Example</title>

<script type="text/javascript">

onload=function(){document.getElementById("INVMERCHANT").value=new Date().getTime();}

</script>

</head>

<body>

<form action="echo.pl" method="POST" >
Invoice No :<input type="text" id="INVMERCHANT" name="INVMERCHANT" value="">
<input type="submit">
</form>

</body>
</html>[/code]
Mike ?
Copy linkTweet thisAlerts:
@banevauthorJan 05.2009 — Thanks Mike
×

Success!

Help @banev spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...