Hi
I have a regular WB16 form in my site.
I need to try and do a validation when pressing the submit button to check the value on a combo box.
If the combo box value is 1 the user should be directed to the normal success page. If the value is 2 they should be directed to a different page.
Is this possible or is there another way I can achieve this validation?
Form Validation Help
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
Re: Form Validation Help
There is no standard option for this, this will require a custom script.
- BaconFries
-
- Posts: 5788
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Form Validation Help
See the following url. Note provided for information only no help implementing.
https://stackoverflow.com/questions/457 ... -they-have
https://stackoverflow.com/questions/457 ... -they-have
-
-
- Posts: 33
- Joined: Wed Mar 07, 2012 10:17 pm
Re: Form Validation Help
Thanks Both
I think i might have found a solution.
If the combo box value is 1 the page will be normal but if the combo box value is changed to 2 i will hide the normal submit button and show a 2nd submit button which goes to a different success page.
Will this work?
I think i might have found a solution.
If the combo box value is 1 the page will be normal but if the combo box value is changed to 2 i will hide the normal submit button and show a 2nd submit button which goes to a different success page.
Will this work?
Re: Form Validation Help
A form can only have one success page. So, using a different submit button will not work.
-
-
- Posts: 33
- Joined: Wed Mar 07, 2012 10:17 pm
Re: Form Validation Help
I'm trying to implement the JS code from this link:
https://stackoverflow.com/questions/457 ... -they-have
Where do I put this code in my WB16 page?
https://stackoverflow.com/questions/457 ... -they-have
Where do I put this code in my WB16 page?
Code: Select all
redirectPage() {
// Gets value of dropdown
var selectedOption = $("#sponsor option:selected").val();
// Picks correct url to go to
var url;
switch(selectedOption) {
case "mark":
url = "your link #1 here";
break;
case "markus":
url = "your link #2 here";
break;
default:
url = "";
break;
}
// Changes current page and keeps back history
window.location.assign(url);
}
- BaconFries
-
- Posts: 5788
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Form Validation Help
See the above. You will also need to modify to suit your own needs so a understanding of javascript or jQuery is needed.BaconFries wrote: ↑Tue Aug 17, 2021 11:57 am Note provided for information only no help implementing.
-
-
- Posts: 33
- Joined: Wed Mar 07, 2012 10:17 pm
Re: Form Validation Help
Thanks BaconFries
I understand what needs to be changed in the code to suit my page. I have done this already.
I just don't know where to put the code. Can this be added in a HTML object or does it need to go in the submit button object HTML and which tag should it go after or before?
I understand what needs to be changed in the code to suit my page. I have done this already.
I just don't know where to put the code. Can this be added in a HTML object or does it need to go in the submit button object HTML and which tag should it go after or before?
Re: Form Validation Help
Normally, scripts are place between the head tags.I just don't know where to put the code.
You should add <script></script> tags around the code.which tag should it go after or before?