HELP ME WITH THIS FORM VALIDATION PLEASE
Posted: Tue Oct 29, 2002 10:13 pm
I appreciate all the help, I have had from all of u guys... volka, phpScott, hob_goblin, takuma, avatar, mydimension ... etc. etc... and from all of u that I didnt mention 'coz I forgot ur nicks.
But since I continue stuck tryin to do a validation to my form, and what I'm receiving sometimes to the other side, once the form has been submitted... is trash
!... (I'm using the POST method ok ?)
And I said sometimes 'coz when u do not choose a product and its respective quantity what I receive to the other side, the page that process the previous information ... is trash
(empty fields)
Look how is my form to get the idea what I'm dealing with:

Now, let me explain u for a while what I a wished to show u w/the above image
... I have named the drop down menus as products[0], products[1]... and so on until products[9] 'coz in the page receiving the info coming from this form (I gonna refer to this page as the 2nd page) I entered all the information coming from the drop down menust in one array called products, and I introduced all the info. coming from the text fields into another array called products_cant. That's why I pointed to the drop down menus and to the combo boxes with red lines in the image, indicating their respective names.
They (the drop down menus and text fields) actually have different names than products and products_cant. But to make the validation easier in the 2nd. page, I introduced all the info into 2 arrays with easy names (products and product_cant, both are arrays as I said).
Now, what I wanna achieve is allow the user to go to the 2nd. page (the page that shows, the product (s) requested, with its/their respective price(s) and quantity(s) ) only if the user chose a product and chose its respective quantity to request. So the 2nd. page could be only accessed if u used the page as is supposted to be used... u cannot choose a product and leave its quantity blank... u cannot choose a product especify its quantity and choose another and leave its quantity field blank, or u cannot especify the quantity of one product and not specify the product by leaving the default message/value of the drop down menu (Choose Product / Remove Product)... got it
If u try to submit the form making one of the mistakes I described above, the page shows u a message saying somethin like "please choose ur product with its respective quantity" or "do not leave blank fields in this form to request ur product"... I dont know... something like that... the point is indicate to the user that s/he left in blank or s/he did something wrong and tried to submit the form with wrong information. (Inside the text boxes, u only can enter digits, thanks to a script volka passed me... I'm gonna try ur script as well phpScott, dont think I didnt appreciate that 'more elegant' code)
The 2nd. page is a confirmation of the products that are being requested in the 1st page. (This is a very rudimentary page I now, but since this is my 1st. "serious" application using PHP/MySQL I dont question myself why I did this or that
... I know, I know... I have a lot to learn yet, but w/ur help, I'm learning a little of PHP day after day
)
ufffffff... finally I finished this, hopefully u got what I wanna make w/my 1st. application.
Thx for ur help guys, and to have taken the time to read all this dissertation

But since I continue stuck tryin to do a validation to my form, and what I'm receiving sometimes to the other side, once the form has been submitted... is trash
And I said sometimes 'coz when u do not choose a product and its respective quantity what I receive to the other side, the page that process the previous information ... is trash
Look how is my form to get the idea what I'm dealing with:

Now, let me explain u for a while what I a wished to show u w/the above image
... I have named the drop down menus as products[0], products[1]... and so on until products[9] 'coz in the page receiving the info coming from this form (I gonna refer to this page as the 2nd page) I entered all the information coming from the drop down menust in one array called products, and I introduced all the info. coming from the text fields into another array called products_cant. That's why I pointed to the drop down menus and to the combo boxes with red lines in the image, indicating their respective names.
They (the drop down menus and text fields) actually have different names than products and products_cant. But to make the validation easier in the 2nd. page, I introduced all the info into 2 arrays with easy names (products and product_cant, both are arrays as I said).
Now, what I wanna achieve is allow the user to go to the 2nd. page (the page that shows, the product (s) requested, with its/their respective price(s) and quantity(s) ) only if the user chose a product and chose its respective quantity to request. So the 2nd. page could be only accessed if u used the page as is supposted to be used... u cannot choose a product and leave its quantity blank... u cannot choose a product especify its quantity and choose another and leave its quantity field blank, or u cannot especify the quantity of one product and not specify the product by leaving the default message/value of the drop down menu (Choose Product / Remove Product)... got it
If u try to submit the form making one of the mistakes I described above, the page shows u a message saying somethin like "please choose ur product with its respective quantity" or "do not leave blank fields in this form to request ur product"... I dont know... something like that... the point is indicate to the user that s/he left in blank or s/he did something wrong and tried to submit the form with wrong information. (Inside the text boxes, u only can enter digits, thanks to a script volka passed me... I'm gonna try ur script as well phpScott, dont think I didnt appreciate that 'more elegant' code)
The 2nd. page is a confirmation of the products that are being requested in the 1st page. (This is a very rudimentary page I now, but since this is my 1st. "serious" application using PHP/MySQL I dont question myself why I did this or that
ufffffff... finally I finished this, hopefully u got what I wanna make w/my 1st. application.
Thx for ur help guys, and to have taken the time to read all this dissertation