Hi
I have a form that allows the user to come back later and edit before submitting
I didn't know how to have a separate "submit" and "save" button, so I have a radio field that has "Editing" and "Completing". If the user selects "editing," the info is saved, if "Completing," the info is saved and an email is sent.
All fields in the form are required
Is there are way to make all fields required only if the "completing" radio is checked?
Hope that makes sense
Thanx!
Mark
I have a form that allows the user to come back later and edit before submitting
I didn't know how to have a separate "submit" and "save" button, so I have a radio field that has "Editing" and "Completing". If the user selects "editing," the info is saved, if "Completing," the info is saved and an email is sent.
All fields in the form are required
Is there are way to make all fields required only if the "completing" radio is checked?
Hope that makes sense
Thanx!
Mark
Hi Mark,
No obvious solution here. It's possible with JavaScript; I think that you can amend validations on the fly so you could turn the 'required' ones on and off. It might be just as simple to keep the 'type' validations in JavaScript but the put the 'required' validations into a serverside validation whch you could make conditional on the radio button value.
Bob
PS You can have multiple submit buttons on a form (I built one with eight this week); use the value to distinguish between them - works more or less like your radion buttons e.g. value='Save' and value='Complete'
No obvious solution here. It's possible with JavaScript; I think that you can amend validations on the fly so you could turn the 'required' ones on and off. It might be just as simple to keep the 'type' validations in JavaScript but the put the 'required' validations into a serverside validation whch you could make conditional on the radio button value.
Bob
PS You can have multiple submit buttons on a form (I built one with eight this week); use the value to distinguish between them - works more or less like your radion buttons e.g. value='Save' and value='Complete'
Thanx
Not sure I follow on multiple submit buttons -
can I see an example of your form?
Not sure I follow on multiple submit buttons -
can I see an example of your form?
Hi Mark,
There isn't much to see, the values are the words you see on the buttons (there were six not eight).
Bob
There isn't much to see, the values are the words you see on the buttons (there were six not eight).
Bob
I guess I'm confused
If I have two submit buttons, how will the form know not to send an email if "save" is clicked, and to send the email if "submit" is clicked?
If I have two submit buttons, how will the form know not to send an email if "save" is clicked, and to send the email if "submit" is clicked?
Hi Mark,
You can detect the value of the submit button and make your actions conditional on that. In the six button code I posted I used two copies of my Event Switcher action to back up different database tables.
Bob
You can detect the value of the submit button and make your actions conditional on that. In the six button code I posted I used two copies of my Event Switcher action to back up different database tables.
Bob
Hello,
you wrote in the thead "In the six button code I posted I used two copies of my Event Switcher action to back up different database tables"..
I can't find this code,
could you please specify where it is ?
(I am also interested in using the Event Switcher action...)
Thank you,
Liora
you wrote in the thead "In the six button code I posted I used two copies of my Event Switcher action to back up different database tables"..
I can't find this code,
could you please specify where it is ?
(I am also interested in using the Event Switcher action...)
Thank you,
Liora
Hi Liora,
The code isn't here it was on a form built for a client, it isn't very complicated. The form with the six buttons that is shown here just has a different value for each submit button and the Event switcher used a PHP switch statement to trigger a particular event if depending on the value of the submit button.
Bob
The code isn't here it was on a form built for a client, it isn't very complicated. The form with the six buttons that is shown here just has a different value for each submit button and the Event switcher used a PHP switch statement to trigger a particular event if depending on the value of the submit button.
Bob
This topic is locked and no more replies can be posted.