Hello guys,
I met a problem about php and javascipt
For a tickets booking system, when a customer search for flights from one city, so in the data base there should be many routes to different cities, like from Sydney, it can go to Landon, Paris and Beijing and etc. So first I use php to get the data from data base, and use a loop to list all of them and after each route, there is a input field which type is text for the customer to enter the tickets quantities they want to by, and I name the input fields by using the loop, from i=1 to i='number of records' . Now the problem is I have to check the validation of the entered quantities be from 1 to 6, which means the customer just can buy six tickets for one routes. how can I get the variables from the form, because I also use some inputs fields to transfer other data.this is how I define the input fields in php:[PHP] print "<input type=\"text\" id=\"$i\" name=\"ticket_$i\" size=\"3\" value=\"\">";[/PHP]
How can I use Javascript to check the validation of this fields?
Many thanks first.