|
So I am not really good at PHP. I can do the basic forms and it works well. Now I am trying something a little more than basic, and I don't know how to do if/then statements. I could pull something out of my butt, but I know that won't work.
The setup:
I am doing an online form for a vehicle carrier. Generally the customer only needs to input information for one vehicle. Sometimes, however, they may need to input information for a few. The vehicle infromation that is essential is 'transportation mode,' 'year,' 'make,' 'model,' 'vin #,' and 'registered owner.' 'Transportation mode' is a multi-choice radio, the rest are text boxes.
Now when you go onto the form, only one vehicle information block is show (called Vehicle #1) , the other four (Vehicles #2-5) are in hidden div tags, once you click on the "Add Another Vehicle" button at the end of one vehicle information block, the next one is shown.
The concept:
Since a client will always have to ship at least one vehicle, the required information for Vehicle #1 will be always in place (you know, if the don't fill in these specific text boxes, they cannot send the form), that part I have down fine. It's the other part that is my problem.
Obviously if they aren't going to be shipping 5 vehicles, I cannot have the form refusing to send because information was not filled out on Vehicles #2-5. I do, however, want some statement that IF the client started filling out information on vehicle 2, 3, 4, or 5, (for example picked the transport mode radio 'mode02') THEN the year, make, model, vin, and owner must be filled out on that vehicles information in order to send the form.
The problem:
I have no idea how to do that.
I hope I have been clear and consice, and I am sure that you guys here can help. I jsut hope I can understand it!
Thanks
|