Validation radio group

Post any questions you may have here

Validation radio group

Postby Rajah on Wed May 21, 2008 5:02 pm

I have the form working now with copy to sender, thanks to sender, email template, redidrect to url, anti spam, backup ;) , export records and attachments. To be short: a very nice component! Much much better than FacileForms.

There is just one problem left: validation of the radio group.
I did put the field name in 12: Radio/Checkbox (and tried other fields too) but it does noet work. Or does it on your computer :laugh:
Rajah
Fresh Boarder
 
Posts: 18
Joined: Mon May 05, 2008 6:38 pm

Re:Validation radio group

Postby GreyHead on Wed May 21, 2008 7:24 pm

Hi Rajah,

You need to do something slightly different with checkbox validation and ChronoForms doesn't yet support it properly. You need validate-one-required. If you search the forums there's been a recent post about this - in the last week or two I think.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3198
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Validation radio group

Postby Rajah on Wed May 21, 2008 8:07 pm

Hi Bob,

Is far as I did understand what was posted before,I did use the "validate-one-required"
That you have to choose one of the radio selections works well.
The problem is that the form will be sent, even if there has not have been made a choise.
Code: Select all
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>   
<div class="kampeermiddel">
<label>Kampeermiddel: Caravan<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Caravan')  echo 'checked'; ?> value="Caravan" />
<label>Camper<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Camper')  echo 'checked'; ?> value="Camper" />
<label>Vouwwagen<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Vouwwagen')  echo 'checked'; ?> value="Vouwwagen" />
<label>Tent<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Tent')echo 'checked'; ?> value="Tent" class="validate-one-required" />  </div>  </td>
</tr>
</table>
I found that if you (I) use the radio codes as:
Code: Select all
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>   
<div class="kampeermiddel">
<label>Kampeermiddel: Caravan<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Caravan')  echo 'checked'; ?> value="Caravan" />
<label>Camper<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Camper')  echo 'checked'; ?> value="Camper" />
<label>Vouwwagen<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Vouwwagen')  echo 'checked'; ?> value="Vouwwagen" />
<label>Tent<input type="radio" name="kampeermiddel" <?php if($_POST['kampeermiddel'] == 'Tent')echo 'checked'; ?> value="Tent" class="validate-one-required" />  </div>  </td>
</tr>
</table>
the validation does not work at all anymore in most cases.

(Sorry, can't get the code right. It differs from Preview, where it is ok.)
Rajah
Fresh Boarder
 
Posts: 18
Joined: Mon May 05, 2008 6:38 pm

Re:Validation radio group

Postby GreyHead on Thu May 22, 2008 7:40 am

Hi Rajah,

No idea what's happening here, I'll take a look later on.

Bob

PS Yes the forum code handling is messed up badly, don't know why. I have to replace all < with &lt; and then the line-breaks in the plain text get messed sometimes :-(
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3198
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Validation radio group

Postby Rajah on Thu May 22, 2008 8:07 am

Hi Bob,

1. I found out that using mootools in Validation this problem is solved. The only thing now is that the validation does not check the radio group as a required field.

2. Is it possible to keep the form data of the upload field of an attachment?

3. Is it possible to have the messages in another color?

These are questions of a perfectionist ;)
Rajah
Fresh Boarder
 
Posts: 18
Joined: Mon May 05, 2008 6:38 pm

Re:Validation radio group

Postby hicksticks2001 on Thu Jun 26, 2008 9:01 pm

There is a java file called validation.js. If you search the file for the words "style" you will find it setting the style DISPLAY to NONE. You can add other attributes such as color or strength, and it will work properly.
hicksticks2001
Fresh Boarder
 
Posts: 9
Joined: Thu Jun 26, 2008 8:28 pm


Return to Questions & Answers

Who is online

Users browsing this forum: Google [Bot], MSNbot Media, Yahoo [Bot] and 3 guests