CalcBuilder Forum

Email validation

Usuario _MSTeam# 2012-07-20 09:34:02

Here is the solution to add an email validation to one of your form fields, which you have typed 'text'.

Go to javascript events, and write this:

getCBFormValue('x').addClass('validate-email');


Where 'x' is the field ID (from fields and code tab).

Moonsoft support 2012-07-23 06:19:01

I tried this and didn't have success. In my case the name of the field variable is email.

Here's what I put in the Javascript events:

getCBFormValue('email').addClass('validate-email');

Did I miss something?

Usuario _MSTeam# 2012-07-23 09:54:58

Hello,

getCBFormValue('email').addClass('validate-email'); is not valid...

Just change 'email' text by the id of this field. You can check the id of the field in 'fields and code' section, on the left side of the field.

For example, if 'email' field has 5 as id, you should write:

getCBFormValue('5').addClass('validate-email');

Regards,

Moonsoft support 2012-07-23 18:55:07

That worked. Thanks!

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!