Checkout Page Form Field Validation
Using eCart 4.5.2 and the Validation Tool Kit 2.3.5 I would like to set up validation for the fields in the checkout.php form that contains both the users Billing and Shipping information. I have done this before for single forms however I am not sure how to approach this if:
1. The user may select the option “Same as billing address” which allows the shipping fields to be automatically populated.
2. If an order does not require Shipping information, as in the case of items that do not need to be shipped (ex. digital downloads).
I have set up a session variable that will tell if the order needs shipping services. Currently, only a message pops up to say that this information is not required. I would prefer to hide that part of the form if not required. I believe that it is called a show/hide region server behaviour but I have never had success trying to create on my own.
From what I have read I belive that I need to split the form in two and use the same name for both? What is the best approach to show/hide the shipping part and apply validation to both sections billing and shipping?