• 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: Validation Textbox before you send the form

Validation Textbox before you send the form 1 year 10 months ago #42081

Hello

I have a form in a private zone only for register users.
When you complete a form on RSForm! Pro you need to click on ENTER or "Send Form" to check which fields are missing to fill in red color.
It is possible inside of one "Textbox" in the tab "Validations" or "Attributes" include an Additional Attributes that show you in green color if the "Textbox" is completed fine? (Which values i need to add)
It is possible at the same time you write on it (then dont need to click on Send or INTO)?

Regards
Last Edit: 1 year 10 months ago by info59685.
The administrator has disabled public write access.

Validation Textbox before you send the form 1 year 10 months ago #42083

Finally it works for me
info59685 wrote:
To archive that scenario :
In the "textbox"which have the Name "name" in Additional Attributes, i write:
onclick="validateName();"

Then in "Form Properties", In Javascript
<script type="text/javascript">
    function validateName() {
      var name = document.getElementById('nombre').value;
      if(name.length == 0) {
        producePrompt('Name is required', 'component89' , 'red')
        return false;
    }
    if (!name.match(/^[A-Za-z]*\s{1}[A-Za-z]*$/)) {
        producePrompt('First and last name, please.','component89', 'red');
        return false;
    }
    producePrompt('Valid', 'component89', 'green');
    return true;
}
 
function producePrompt(message, promptLocation, color) {
  document.getElementById(promptLocation).innerHTML = message;
  document.getElementById(promptLocation).style.color = color;
}
</script>
Last Edit: 1 year 10 months ago by info59685.
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!