ChronoEngine Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Radio validation problem (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Radio validation problem
#8289
Noterious (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Radio validation problem 1 Month, 3 Weeks ago Karma: 0  
I searched all over, but still couldn't find what's wrong with my form.

Let's say I have a form like
Code:

<p> <label> <input type="radio" name="fm" value="1" id="radiooo_0" /> 1</label> <br /> <label> <input type="radio" name="fm" value="2" id="radiooo_1" /> 2</label> <br /> <label> <input type="radio" name="fm" value="3" id="radiooo_2" /> 3</label> <br /> </p>
Then I have a built in javascript radio/checkbox to check the field 'fm' When I click submit, the script returns 'please select one of the above options' on all 3 buttons, not just for the whole group. I really have no idea what is wrong. Please advice.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#8293
GreyHead (Admin)
Admin
Posts: 2807
graph
User Online Now Click here to see the profile of this user
Re:Radio validation problem 1 Month, 3 Weeks ago Karma: 59  
Hi Noterious,

I'm not clear if you are using ChronoForms validation for this. If you are then you need 'validate one required' with a div around the group of fields.

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8295
Noterious (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Re:Radio validation problem 1 Month, 3 Weeks ago Karma: 0  
Thanks Bob,

Yes, I'm trying to use ChronoForms validation for the radio buttons.

By using <div> Do you mean something like this?
Code:

<div> <input type="radio" name="fm" value="1" id="radiooo_0" /> 1 <br /> <input type="radio" name="fm" value="2" id="radiooo_1" /> 2 <br /> <input type="radio" name="fm" value="3" id="radiooo_2" /> 3 <br /> </div>
Or do I have to put in the name="fm" inside the div?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#8298
GreyHead (Admin)
Admin
Posts: 2807
graph
User Online Now Click here to see the profile of this user
Re:Radio validation problem 1 Month, 3 Weeks ago Karma: 59  
Hi Noterious,

Andrew Tetlaw - who wrote the code that ChronoForms uses has this note on the script page:
QUOTE:
*To use the validate-one-required validator you must first add the class name to only one checkbox/radio button in the group (last one is probably best) and then place all the input elements within a parent element, for example a div element. That way the library can find all the checkboxes/radio buttons to check and place the validation advice element at the bottom of the parent element to make it appear after the group of checkboxes/radio buttons.
I'm not sure if ChronoForms does this automatically but you can fix it by putting the class="validate_one_required" in your form html; set Validation to ON in he CF tab but *do not* put anything in the Validate One Required box there.

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#8303
Noterious (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Re:Radio validation problem 1 Month, 3 Weeks ago Karma: 0  
Thank you for pointing me to the right direction, Bob.

I finally did it after a few more googling.

QUOTE:

<div>
<input type="radio" name="fm" value="1" id="radiooo_0" /> 1 <br /> <input type="radio" name="fm" value="2" id="radiooo_1" /> 2 <br /> <input type="radio" name="fm" value="3" class="validate-one-required" id="radiooo_2" /> 3 <br /> </div>


Worked perfectly! By the way, it's 'validate-one-required', not 'validate_one_required'

*I'm wondering what you use Validate One Required box in CF validation tab for then? It doesn't really work at the moment, since it'll just add 'class="validate-one-required" to every radio buttons with the same name.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#8321
admin (Admin)
Admin
Posts: 1570
graphgraph
User Online Now Click here to see the profile of this user
Re:Radio validation problem 1 Month, 3 Weeks ago Karma: 22  
Good catch, do you have the latest version ? if yes then did you make sure it adds this to all radios ? if yes then its a bug and I will try to find a fix!

another point, what if you added it to the first radio and not the last one, does it work ?

Cheers

Max
 
Report to moderator   Logged Logged  
 
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials