Within CMSMS 1.11.4, and Form Builder 0.7.3, I'm trying to setup the following condition for a specific input text field:
If the user fills out this specific field, then don't submit the form.
Is this conditional process possible within Form Builder? If so, how can I incorporate this?
Thanks for any advice!
bh
[SOLVED]Form Builder How to prevent submition if value exist
[SOLVED]Form Builder How to prevent submition if value exist
Last edited by blackhawk on Wed May 15, 2013 3:39 pm, edited 1 time in total.
Re: Form Builder 0.7.3 - How to prevent submition if value e
Regex validation is possible on text input -> Advanced tab.
Re: Form Builder 0.7.3 - How to prevent submition if value e
I will look into that. Thank you for the tip.
Re: Form Builder 0.7.3 - How to prevent submition if value e
Velden, thanks for the feedback, but is there a JavaScript location built into Form Builder where we can validate submitted values before the submission is successful?
For example, if I have a text input field called animals, and someone wrote cat into that field, I could then detect the text value is 'cat' with JavaScript and then either cancel the submission process or do nothing. Where would the appropriate panel be located for this type of action in Form Builder?
Thanks!
For example, if I have a text input field called animals, and someone wrote cat into that field, I could then detect the text value is 'cat' with JavaScript and then either cancel the submission process or do nothing. Where would the appropriate panel be located for this type of action in Form Builder?
Thanks!
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Form Builder 0.7.3 - How to prevent submition if value e
Easy enough to do with jquery in the form template. something like:
Code: Select all
$('form').submit(function(e){
var f = $(this).find('#YOURFIELDSID');
if( typeof f != 'undefined' && $(f).val() != '' ) {
alert('error message');
$(e).preventDefault();
}
});Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Form Builder 0.7.3 - How to prevent submition if value e
I'm assuming that this is for spam prevention... If so, jQuery might not work that well.
http://forum.cmsmadesimple.org/viewtopi ... ct#p277766
http://forum.cmsmadesimple.org/viewtopi ... ct#p277766
Re: Form Builder 0.7.3 - How to prevent submition if value e
Thank you calguy1000 for displaying how easy it is to integrate custom jQuery with Form Builder! That was a root question in the back of my mind, and you just confirmed it for me. Thanks!
Thank you Wishbone for that post. You're jedi powers read through my mind and that was exactly what I was looking for because I am note comfortable yet apply regular expression to form fields...I spend most of my day developing with javascript...
But anyway, thank you guys! I feel like I'm learning new stuff everyday! Cool.
blackhawk
Thank you Wishbone for that post. You're jedi powers read through my mind and that was exactly what I was looking for because I am note comfortable yet apply regular expression to form fields...I spend most of my day developing with javascript...
But anyway, thank you guys! I feel like I'm learning new stuff everyday! Cool.
blackhawk
Re: [SOLVED]Form Builder How to prevent submition if value e
I think Javascript is pretty useless for spam prevention this way.
I'd think spam bots just post their data the the form handler, so no javascript is involved at all.
I'd think spam bots just post their data the the form handler, so no javascript is involved at all.
Re: [SOLVED]Form Builder How to prevent submition if value e
Understood. Thanks for the good tip!


