Hi
I'm working on a checkout page where I have the following functionality:
There is a radio button item with 2 choices:
When a buyer choose for "Pick item up", he only have to fill in his name, email,....
When a buyer choose for "Deliver item", he has to fill in his name, email,... PLUS his address.
With a little bit javascript I figured out to hide or show the address section based on the choice of radio button.
So far so good.
But I would like to give the address input field a 'required' value, but only when the radio button is on "Deliver item". Currently the buyer gets an error message to fill in his address when he is on "Pick item up".
Tried I couple of options, but haven't figured out how to "switch off" the required value when the radio button is on "Pick item up".
Any ideas or tips to get this done?
Thanks!
I'm working on a checkout page where I have the following functionality:
There is a radio button item with 2 choices:
- Pick item up
Deliver item
When a buyer choose for "Pick item up", he only have to fill in his name, email,....
When a buyer choose for "Deliver item", he has to fill in his name, email,... PLUS his address.
With a little bit javascript I figured out to hide or show the address section based on the choice of radio button.
So far so good.
But I would like to give the address input field a 'required' value, but only when the radio button is on "Deliver item". Currently the buyer gets an error message to fill in his address when he is on "Pick item up".
Tried I couple of options, but haven't figured out how to "switch off" the required value when the radio button is on "Pick item up".
Any ideas or tips to get this done?
Thanks!