• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Form Validation - Require Ratio of Fields Complete

Form Validation - Require Ratio of Fields Complete 11 years 11 months ago #23304

  • xover15
  • xover15's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 1
I'm looking for a way to validate a specific ratio or percentage of fields in a form. There are several sections that need a ratio such as (any 2 of 6 fields) complete. I'll continue searching, but wanted to know if anyone has seen something along those lines.

Is there a way to count specific fields and then require >= 2 to be complete?

Thanks for any help.
The administrator has disabled public write access.

Form Validation - Require Ratio of Fields Complete 11 years 11 months ago #23382

  • xover15
  • xover15's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 1
I have come up with a JQuery code that does what I need it to, but now I'm having trouble implementing it into the RSForm Pro setup. I've attached a class to each checkbox i'm wanting to get info from and I've tried several different way of trying to get the onclick to work with the JQuery without any luck.

Here is the code I'm working with:
document.getElementById("test").onclick = function() {
    isCountCheck("Check something");
};
 
function isCountCheck(helperMsg){
    if($("input[class=checkbox1]:checked").length >= 2)
        return true;
    alert(helperMsg);
    return false;
}

I've tried attaching the onclick directly to the button Attribute but that doesn't seem to do anything either.

Thanks for any help.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!