addClass If not validated

  • d4shoerncheN
  • Topic Author
  • Visitor
  • Visitor

d4shoerncheN created the topic: addClass If not validated

Hello,

i have required fields in my forms. Can i add new classes for the input field when validation fails (no matter at Tab or submit)?

Otherwise when the validation is correct (by tab, not by submit) in this input field, they add new class too.

I wish my field would turn red if something wrong or nothing was entered and green by correct input.

Thanks.
#181284
  • Posts: 6478
  • Karma: 170
  • Thank you received: 667

tomeperica replied the topic: addClass If not validated

Hey there,

could you send us your form as Form Package so we can work directly on it, just tell me which field in form you want me to add red and green state?

Follow this steps to create package: crosstec.org/en/support/online-documenta...ted/94-packages.html

Zip it (.zip) and attach here.

Regards,
Tome

Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
#181333
  • d4shoerncheN
  • Topic Author
  • Visitor
  • Visitor

d4shoerncheN replied the topic: addClass If not validated

Thanks for your help.

All required fields on this form.
#181334
Attachments:
  • Posts: 6478
  • Karma: 170
  • Thank you received: 667

tomeperica replied the topic: addClass If not validated

Pls find attached form below, I have made a color validation on your two fields: zuname & email. Download form, unzip it and install it then test. Code is also under Validaition secion in those 2 elements, so you can have an overview how to create for other fields if needed.

Let us know the result.

Regards,
Tome

Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
#181389
Attachments:
  • d4shoerncheN
  • Topic Author
  • Visitor
  • Visitor

d4shoerncheN replied the topic: addClass If not validated

Hello Tome,

that looks good. Thanks.

Is it possible to trigger coloring at TAB button too?
#181390
  • Posts: 6478
  • Karma: 170
  • Thank you received: 667

tomeperica replied the topic: addClass If not validated

Hey there,

yes its possible, follwo this steps to do that. Go to you zuname element -> Advanced tab -> Action Script -> Custom -> Check "Blur" and create frameworkm then i case 'blur' put this function ff_validate_form();

Code should look like this:
function ff_zuname_action(element, action)
{
    switch (action) {
        case 'blur':
ff_validate_form();
            break;
        default:;
    } // switch
} // ff_zuname_action

Same thing you can do for your email element.

Test that solution and let us know the result.

Regards,
Tome

Regards,
Tome
==========================================
Need to renew Pro Support?
Buy Here!
==========================================
Satisfied?
Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
#181407
Moderators: ForumSupporttomeperica
Time to create page: 0.048 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here