Sensibilium
Programmer
I am currently developing a database-driven website, which will hopefully provide vistors with a list of all wedding lists currently on file. This is the simple bit, and basically solved.
My main problem is the form validation.
weddings.asp - Displays all wedding lists from the database, creating the link to each list as going through the loop.
weddinglist.asp - Displays all items on the selected wedding list.
Now, on the weddinglist.asp page, the Quantity Required is calculated from the Quantity Ordered less the Quantity Sold, and the user is given the option of entering the number of that product they wish to purchase with an input text box (there is one input text box per product item line).
After the user has entered all the quantities required they will then click on the 'Calculate' button, which takes the Quantity Required and multiplies it by the Retail Price, for each product item line, and adds them all together to give a total cost to the user.
I have written (and stolen and ripped, etc.) the Javascript to verify that the Quantity entered by the user is not more than the Quantity Available and to Calculate the total cost, the problem occurs when I test for cross-browser compatibility.
Currently, when the user enters the Required Quantity the value is checked when the field loses focus (using onBlur), and the Total Cost is calculated when the button has been clicked (using onClick). This doesn't work with NS4.7 and crashes NS6 under certain circumstances (only when a user enters an invalid Quantity value and immediately clicks the Calculate button).
So, to cut this post short, my hope is that someone could point me in the right direction for the browser problems I'm suffering. I'm thinking that probably the best way would be to check the Quantities entered by the user only after the Calculate button has been pressed, but I have no idea how to connvert my code to do this!
Any help would be greatly appreciated. Ahdkaw
"What would you expect from a bunch of monkeys?"
My main problem is the form validation.
weddings.asp - Displays all wedding lists from the database, creating the link to each list as going through the loop.
weddinglist.asp - Displays all items on the selected wedding list.
Now, on the weddinglist.asp page, the Quantity Required is calculated from the Quantity Ordered less the Quantity Sold, and the user is given the option of entering the number of that product they wish to purchase with an input text box (there is one input text box per product item line).
After the user has entered all the quantities required they will then click on the 'Calculate' button, which takes the Quantity Required and multiplies it by the Retail Price, for each product item line, and adds them all together to give a total cost to the user.
I have written (and stolen and ripped, etc.) the Javascript to verify that the Quantity entered by the user is not more than the Quantity Available and to Calculate the total cost, the problem occurs when I test for cross-browser compatibility.
Currently, when the user enters the Required Quantity the value is checked when the field loses focus (using onBlur), and the Total Cost is calculated when the button has been clicked (using onClick). This doesn't work with NS4.7 and crashes NS6 under certain circumstances (only when a user enters an invalid Quantity value and immediately clicks the Calculate button).
So, to cut this post short, my hope is that someone could point me in the right direction for the browser problems I'm suffering. I'm thinking that probably the best way would be to check the Quantities entered by the user only after the Calculate button has been pressed, but I have no idea how to connvert my code to do this!
Any help would be greatly appreciated. Ahdkaw
"What would you expect from a bunch of monkeys?"