Connecting Tech Pros Worldwide Help | Site Map

To check for validity......

Member
 
Join Date: Aug 2008
Posts: 40
#1: Nov 14 '08
I posted this same question previously to generate form fields dynamically but now i have got one more doubt..pls help me..I am doing an inventory project using PHP and in Sales/Rentals page there is a text box.The customer id should be entered in that text box or entered using a barcode reader.If that customer id is valid,another text box should be generated in which the product id should be entered..If that product id is valid,other 3 text boxes should be generated dynamically in order to do transaction.It is possible for me to generate text boxes dynamically using javascript but I dont know how to check whether the customer id and product id are valid using javascript....
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Nov 14 '08

re: To check for validity......


this depends on the amount if ids to check. if there are only some you can store them in the script. if you have too many you could use ajax to connect to the server and do the check there.

regards
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#3: Nov 14 '08

re: To check for validity......


Quote:

Originally Posted by Dormilich

this depends on the amount if ids to check. if there are only some you can store them in the script. if you have too many you could use ajax to connect to the server and do the check there.

regards

AJAX is the proper way of doing this. Storing them in the script (or loading them into an array when the page loads) does not take into account ids added after the page has been loaded.
Reply