• 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: Conditional validation

This message has been removed by user's request. 11 years 3 months ago #28962

  • 54da7a6089bad0cdb5198797e64825f2
  • 54da7a6089bad0cdb5198797e64825f2's Avatar
This message has been removed by user's request.
The administrator has disabled public write access.

Conditional validation 11 years 3 months ago #28977

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
Simply set the fields as 'required' and you're done. You can do so in Components >> RSForm!Pro >> Manage Forms >> edit your form >> Components >> edit a field >> Validations >> set "Required" to "Yes". You can read more about RSForm!Pro's select fields in the following articles:

www.rsjoomla.com/support/documentation/v...le/827-dropdown.html

www.rsjoomla.com/support/documentation/v...-checkbox-group.html

www.rsjoomla.com/support/documentation/v...829-radio-group.html

You can edit the error message in Components >> RSForm!Pro >> Manage Forms >> edit your form >> Properties >> Form Info >> click on "Edit the Error Message":

www.rsjoomla.com/support/documentation/v...form-properties.html
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

This message has been removed by user's request. 11 years 3 months ago #29005

  • 54da7a6089bad0cdb5198797e64825f2
  • 54da7a6089bad0cdb5198797e64825f2's Avatar
This message has been removed by user's request.
The administrator has disabled public write access.

Conditional validation 11 years 3 months ago #29013

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
You can use a PHP script that verifies the value chosen in, let's say, Field A and, based on that selection, invalidates Field B if no value was submitted within it.

To invalidate a field, you will need to use the following line of code (example):

$invalid[] = RSFormProHelper::getComponentId('maat1');

The script will need to be added in Components >> RSForm!Pro >> Manage Forms >> edit your form >> PHP Scripts >> Script called on form process.

You can read more on RSForm!Pro's PHP scripting areas here:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

This message has been removed by user's request. 11 years 3 months ago #29016

  • 54da7a6089bad0cdb5198797e64825f2
  • 54da7a6089bad0cdb5198797e64825f2's Avatar
This message has been removed by user's request.
The administrator has disabled public write access.

Conditional validation 11 years 3 months ago #29017

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
You will need to use that line of code within a condition:

if (condition)
{
$invalid[] = RSFormProHelper::getComponentId('maat1');
}
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
The following user(s) said Thank You: 54da7a6089bad0cdb5198797e64825f2

This message has been removed by user's request. 11 years 3 months ago #29018

  • 54da7a6089bad0cdb5198797e64825f2
  • 54da7a6089bad0cdb5198797e64825f2's Avatar
This message has been removed by user's request.
The administrator has disabled public write access.

Conditional validation 11 years 3 months ago #29026

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
Hi,

Please add the following code:

if ($_POST[0]<>"")
{
if($_POST[0]=="")
{
$invalid[]=RSFormProHelper::getComponentId('maat1');
}
elseif ($_POST[0]=="")
{
$invalid[]=RSFormProHelper::getComponentId('aantal1');
}
}

in Components >> RSForm!Pro >> Manage Forms >> edit your form >> Properties >> PHP Scripts >> Script called on form process.

Note that this code is suitable if you are using dropdowns for the 'extra1', 'maat1' and 'aantal1' fields.

Also, note that you should have an item with no value set as the default selection in the dropdown:

|Please select an item

Try this and let me know how it works out!
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

This message has been removed by user's request. 11 years 3 months ago #29029

  • 54da7a6089bad0cdb5198797e64825f2
  • 54da7a6089bad0cdb5198797e64825f2's Avatar
This message has been removed by user's request.
The administrator has disabled public write access.

Conditional validation 11 years 3 months ago #29032

  • silviup
  • silviup's Avatar
  • OFFLINE
  • Moderator
  • Posts: 309
  • Thank you received: 49
Please try this code:
if ($_POST['form']['extra1'][0]<>"")
{
	if($_POST['form']['maat1'][0]=="")
	{
		$invalid[]=RSFormProHelper::getComponentId('maat1');
	}
	elseif ($_POST['form']['aantal1'][0]=="")
	{
		$invalid[]=RSFormProHelper::getComponentId('aantal1');
	}
}
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 11 years 3 months ago by silviup.
The administrator has disabled public write access.

This message has been removed by user's request. 11 years 3 months ago #29035

  • 54da7a6089bad0cdb5198797e64825f2
  • 54da7a6089bad0cdb5198797e64825f2's Avatar
This message has been removed by user's request.
Last Edit: 11 years 3 months ago by 54da7a6089bad0cdb5198797e64825f2.
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!