Validate with "not equal to"

Issues related to forms.
Post Reply
mike_kallet
 
 
Posts: 23
Joined: Tue Jan 18, 2011 2:34 pm
Location: Denver, Colorado, USA
Contact:

Validate with "not equal to"

Post by mike_kallet » Tue Oct 16, 2018 3:11 am

In my form, I use validate for some of the fields, including using the option "must have the same value as" (I do this to verify the email address). Is there a way to have other conditions, such as "must NOT have the value as", as I'm trying to ensure a unique entry instead of a duplicate.
Thanks
Mike

User avatar
Pablo
 
Posts: 14087
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Validate with "not equal to"

Post by Pablo » Tue Oct 16, 2018 5:52 am

There is no standard option for this, this will require a custom script.

mike_kallet
 
 
Posts: 23
Joined: Tue Jan 18, 2011 2:34 pm
Location: Denver, Colorado, USA
Contact:

Re: Validate with "not equal to"

Post by mike_kallet » Wed Oct 17, 2018 3:22 pm

Thanks. Years ago, before validate existed in form fields, I wrote a script to compare emails. The javascript was in the page properties and I called it on click of the submit button, returning either true or false. Will that strategy still work (I'm trying to prevent spam by determining if "html" or "htmls" is used in the comment fields. Thx.

User avatar
Pablo
 
Posts: 14087
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Validate with "not equal to"

Post by Pablo » Wed Oct 17, 2018 3:59 pm

I doubt that a JavaScript will prevent spam.

But maybe you can use the 'match' option?
If you activate 'Enable server sided validation' in the form then the values will also be validated on the server with PHP.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests