[RESOLVED] Can JavaScript validate & verify code entered by customer in my site?
Hi there
Is it possible to create a JavaScript that can validate the form and check against the code secretly kept on the server? If the customer enters the correct code, I want the script to take them to the paypal page to pay the discounted amount. If they enter incorrect code, I want the script to redirect them back to the "enter code" page.
Background
On my site, existing customers can purchase other services on a discount. I have displayed two prices: for example £199 for existing customers and £249 for new customers.
Those who are existing customers, they will click and go the next page where they will see a text link that says:
Click to enter verification code & pay discounted price.
When they click the link, an HTML form will ask the user to enter a verification code. This is the code they have received in an email when they previously bought a package from us.
Better use a server-side code for that. Javascript is a client-side language, it was not meant to perform a user/password job nor any kind of. The client-side code can not be hidden, it is to be seen by the user, if he wants to. There are methods to encrypt somehow the javascript code, but, logically, if someone can see the encrypted code, sooner or later he will be able to decipher it.
And if you are dealing with money: not even think of.
It is do with money and now that you have convinced me to look for server side coding like PHP etc, I will look into it.
I'd like to take this opportunity to thank you for resolving this little challenge of mine. Imagine me using JavaScript for password checking...lol that would have been something.
Bookmarks