Check duplicate values in textarea?

  • Masseto
  • Masseto's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 28
  • Thank you received: 0

Masseto created the topic: Check duplicate values in textarea?

Hello everyone,
I have created a form with two text fields. I have to check duplicate values.

Example: What animals do you have?
Text Field 1: Dog
Text Field 2: Dog (error message box: duplicate value!)

thanks
#150183
  • Posts: 15270
  • Karma: 287
  • Thank you received: 1074

pedro81 replied the topic: Check duplicate values in textarea?

You need a little custom validation:

go to your second element, Text Field 2 > Validation area:
Validation: Custom
Error message: Valore duplicato!
Enter this code into the text area:
function ff_elem2_validation(element, message)
{
    if (element.value == ff_getElementByName('elem1').value) {
        if (message=='') message = element.name+" faild in my test.\n"
        ff_validationFocus(element.name);
        return message;
    } // if
    return '';
} // ff_elem2_validation

where elem2 is the name of this Text Field 2 element, and elem1 is the name of your Text Field 2. If you have different names for this elements, just change the name into the script and save it.

I hope this helps.

Regards,
Pedro
=========================================Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
==============================================
#150184
  • Masseto
  • Masseto's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 28
  • Thank you received: 0

Masseto replied the topic: Check duplicate values in textarea?

I join.
#150185
  • Posts: 15270
  • Karma: 287
  • Thank you received: 1074

pedro81 replied the topic: Check duplicate values in textarea?

Ok!

Fateci sapere se avete ulteriori domande.

Regards,
Pedro
=========================================Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
Follow us on Twitter
==============================================
#150187
  • Masseto
  • Masseto's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 28
  • Thank you received: 0

Masseto replied the topic: (SOLVED) Check duplicate values in textarea?

Solved. thanks
#150623
  • Posts: 1
  • Thank you received: 0

ryanwang replied the topic: (SOLVED) Check duplicate values in textarea?

It depends on which platform you are using. You can use DuplicateFilesDeleter for this purpose
#236121
Moderators: ForumSupporttomeperica
Time to create page: 0.076 seconds

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

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€

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!

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