cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Required Radio Button Selection
October 10, 2008
8:26 am
Herman
Guest

Please replace the ??? with your data!

  • URL to the FORM: http://???
  • The browser used: Firefox 3.0.3 (Windows XP)
  • cforms version: 9.0b
  • Your Wordpress version: 2.6.2

[desc]: I'm don't seem able to set radio buttons to "Required" (the option is greyed out), and visitors are able to submit the form without selecting any radiobuttons.
_

EDITED

First of all, great plugin!

I'm working on a wedding site for me and my fiancée, and are looking for a way to let guests RSVP online. I'm trying to use cforms and database tracking for this. The form currently have a few fields with name, optionally telling us about food allergies and so on. But the primary part is the leading RSVP question with the radio button options Yes/No. It's a good thing they have no default value, so the guest have to select either one. The bad thing is that the form settings won't let me set any sort of "required" option on the radio buttons, so if guests forgets pushing any of the buttons, the form still validates, and the field will be empty.

Is this how radio buttons are supposed to work by design, and I'm doing it wrong? Is this a fixable or work-around-able bug, or does the solution lie somewhere else?

EDIT:

Ok, so I thought I had thouroughly searched the forum before submitting the question, but widened mysearch afterwards and read through a couple of posts that I first didn't find relevant.

so:

"Troubleshooting: radiobuttons" thread starting about formatting and <br> in radiobuttons so I ignored it first bu further down I found:

That's default behaviour, however radio boxes can not be made "required".

And in another thread "Feature Request: ability to require radio and check box selection" It is suggested multiple drop down, but that don't seem to apply to my case (shouldn't select both yes and no)

So I'm still unsure what to do…

October 10, 2008
9:14 am
Herman
Guest

Ok, so it seems I solved it by using a select box, and applying the last suggestion form the select box manual

Select box marked "Required": Using a minus symbol - as the value (after |), will mark an option as "not valid"! Example:
Your age#Please pick your age group|-#12 to 18|kiddo#19 to 30|young#31 to 45#45+ |older.
"Please pick…" is shown but not considered a valid value.

I finally figured the solution was to add an invalid "Please pick…" as first option of the select box. It seems obvious now, but for some reason I couldn't see this solution earlier… I still think that a radio button would have been the logical way to do it, but found a workaround.

October 11, 2008
7:49 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Is this how radio buttons are supposed to work by design, and I'm doing it wrong? Is this a fixable or work-around-able bug, or does the solution lie somewhere else?

one of the radio buttons *should* always be selected. the fact that cforms allows you to not click any (by default) has been a requested feature but really isn't how radio buttons meant to function.

The select box is the better choice in your case (or you could have marked a radio button to be the preferred selected by default).

October 13, 2008
10:55 pm
Dave
Guest

Could someone please clarify whether Radio Buttons should be working in their traditional design and functionality of always having one button selected?

They do not do this for me, so if this bug is going to be fixed could you please let me know when.

This is the only problem I have found with this otherwise awesome plugin.

Thanks,

Dave.

October 13, 2008
11:05 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

They do not do this for me, so if this bug is going to be fixed could you please let me know when.

What do you mean by that? Of course you can preset one of the radio buttons by configuration…

October 13, 2008
11:14 pm
Dave
Guest

Hi Oliver,

Let me explain…

I do not want a user to submit my form without one of the radio buttons in the group being selected.

Currently the user can submit the form without any radio button being selected.

I cannot see how to set a radio button group to be required.

Is there a way to change this so that the user must select one of the radio buttons before the form is valid?

Dave.

October 13, 2008
11:21 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Then you simply need to set one of your radio buttons as the default one:

e.g. if this is your config string (it's easier in the UI popup dialog):

my options#abc#def#ghi

then you can preset one  of the fields:

my options#abc|set:true#def#ghi

October 13, 2008
11:53 pm
Dave
Guest

Thanks Oliver – that fixed it!

October 21, 2013
7:50 pm
Henry
Guest

Hi Oliver,

How can i get radio button value to send by email ?

{cf_form1_my options} don't work !

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3744

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5345

Posts: 18714

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)