• 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: How to require a specific value in a radio button

How to require a specific value in a radio button 11 years 9 months ago #24283

  • jeffhoneyager
  • jeffhoneyager's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 46
  • Thank you received: 8
I have a radio button "Do you accept the Terms & Conditions"

Options are "Yes" or "No" The caption is a link for a pop up of the article. All works fine.

How do I require / test for a "Yes" response?

If value:accept<>"Yes" then error with message "You must accept the terms and conditions."

(or some such code)

Thanks!
The administrator has disabled public write access.

How to require a specific value in a radio button 11 years 4 months ago #26125

  • ROADSIDE
  • ROADSIDE's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
I'd like to get an answer to this question as well. Thanks.
The administrator has disabled public write access.

How to require a specific value in a radio button 11 years 3 months ago #26132

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

You can try using the $invalid method for your radio group:

www.rsjoomla.com/support/documentation/v...602-php-scripts.html

Basically a script in "Scripts called on form process"(backend > Components > RSForm!Pro > Manage Forms > your form > Properties > PHP Scripts) can be used to check if the radio value is "Yes" or not. Example:
$myRadio = $_POST['form']['my-radio-group-name'];
if($myRadio != "Yes"){
		$invalid[] = RSFormProHelper::getComponentId('my-radio-group-name');
}

Another approach on adding terms and conditions functionality to a form is explained here:

www.rsjoomla.com/support/documentation/v...s-functionality.html
This is not official customer support. To receive your support, submit a support ticket here.
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!