• 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: Using Checkboxes to indicate ON or OFF

Using Checkboxes to indicate ON or OFF 12 years 6 months ago #15238

  • patgaytx
  • patgaytx's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
How can I use a single check box to identify if an particular scenario exists or not? Think of it as ON or OFF.

For example -
The form has the following Question:
Is this a Duplicate Item? ( )

If there is no duplicate, there'd be no check in the checkbox. In this case, I'd want to write a 0 to the database upon Form Save.
If there is a duplicate, there would be a check in the checkbox. In this case, I'd want to write a 1 to the database upon Form Save.

Any thoughts?
The administrator has disabled public write access.

Re: Using Checkboxes to indicate ON or OFF 12 years 6 months ago #15262

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Please note that you can use custom coding in the "Items" section of the checkbox group. More details are available here:

http://www.rsjoomla.com/support/documentation/view-article/57-components.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.

Re: Using Checkboxes to indicate ON or OFF 12 years 6 months ago #15289

  • swhung
  • swhung's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 2
How do I default a single checkbox to "checked"?
The administrator has disabled public write access.

Re: Using Checkboxes to indicate ON or OFF 12 years 6 months ago #15291

You can use the following command [c] on the line you want to be the default.
For example, in a radio group enter your list
-10
-5
0 [c]
5
10
When the form displays the "0" button will be selected. The user could then click on any other button and change the selection. The command also works with other components.
Hope this helps.
The administrator has disabled public write access.
The following user(s) said Thank You: swhung

Re: Using Checkboxes to indicate ON or OFF 12 years 3 months ago #15913

... Radiogroup radio checked selected syntax ...

There seem to be a lot of answers to the question of "how to I set a radio button to be initially enabled" - up to using onFocus scripts which detect if it's an intial doc load ...

1. This FAQ solution may apply okay for checkboxes and dropdowns. But, it fails to work for radio groups (www.rsjoomla.com/support/view-article/12...s-and-dropdowns.html)

Namely, Paris{checked}|Paris ... does not appear to work in my version of RSForm Pro (v1.3.0R36 in J1.7.3)
... but it's partly useful/correct in setting different values for the field Name and Label

2. The javascripting solutions mentioned elsewhere in the forums just to set the initial state to checked are a) unnecessary and b) overkill to set the initial check state of a radio button

Anyway ...

I have a form which gathers contact info: Phone, Email ... and then a radio group which indicates visitor's preference for being contacted (ie, Phone or Email)

For various reasons, we want the field names to be unique - ie, the name of the Phone textbox control shouldn't conflict with the Phone radio control's name.

Sooo ...
1. I use part of the info from the FAQ above - namely the "|" syntax
2. I use the "[c]" command notation mentioned in the previous post to set the initial checked state

In the items section, I have:
PrefPhone|Phone [c]
PrefEmail|Email

The radio control is named "PrefPhone" but the label displayed to the visitor is "Phone" ... and Phone is initially checked enabled.

If it works correctly, the radio control should appear checked in the RSForm manager (admin) ... as well as when you load your form on your web page.

Hope that helps.
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!