• 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: Unique Field - Combination of Two Fields

Unique Field - Combination of Two Fields 10 years 2 weeks ago #31018

  • Kasparek
  • Kasparek's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Two independent text boxes exist in a form:
- First Name
- Last Name
Is it possible to setup a validation rule that would check for uniqueness of a combination of First and Last Name fields?
The administrator has disabled public write access.

Unique Field - Combination of Two Fields 10 years 2 weeks ago #31023

  • bogdan.tataru
  • bogdan.tataru's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 174
  • Thank you received: 40
You can achieve this using a textbox and some JavaScript code. In administration page Components >> RSForm! PRO >> Manage Forms, edit your form and add a textbox named for example "UniqueName" but don't complete the caption field. On its Validations tab choose as Validation Rule "Unique Field" and as Validation Message: "Name must be unique" (the message you want to display). Go to Attributes tab and set style="display:none;" in the Additional Attributes field. In this way the field will be hidden.

When the submit button will be pressed the First Name and Last Name must be concatenated and added in the "UniqueName" field value.

In order to do this you have to edit your submit button and add on its Additional Attributes field onclick="myFunction();". For the function go to Properties tab >> CSS and Javascript and add the following script in the Javascript field:
<script>
function myFunction ()
 {
document.getElementById('UniqueName').value = document.getElementById('First Name').value + ' ' + document.getElementById('Last Name').value;
return true; 
} 
</script>
My help is not official customer support. To receive assistance, submit a ticket by clicking here
Last Edit: 10 years 2 weeks ago by bogdan.tataru.
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!