Forums

Selection Validation does not seem to work

matthews_p 10 Jan, 2008
Hi All,

I'm trying to implement some validation on a select box, with the built in javacript validation in version J1.5, however it seems not to be working!

My form code for the select is:


<select name="title" id="title">
<option value="Select" selected="selected">Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Dr">Dr</option>
<option value="Other">Other</option>
</select>


In the Validation tab, I include title in the required fields, and Select as a property of validate-selection. However, it doesnt seem to kick in when the submit button is clicked.

Any help would be much appreciated!

Thanks,

Peter
GreyHead 10 Jan, 2008
Hi Peter,

There is a problem with Validation in the J1.5 version (there's a post in the announcements forum here). Basically ChronoForms uses the Prototype library for validation, Joomla 1.5 has the MooTools library built in and the two clash.

ChronoForms 2.3.7 for Joomla 1.0.x released this week has an option to use the MooTools library for validation and I know that Max is working towards putting this in a J1.5 release as soon as he can.

Bob
jvince 10 Jan, 2008
Would it not be best to just use PHP for validation, so as to avoid all the issues with JavaScript?

Pretty please🙂

Thanks for listening and a great job so far.

- Vince
GreyHead 10 Jan, 2008
Hi Vince,

There's nothing to stop you using PHP for your validation. Just turn off the ChronoForms validation and write your own PHP code for the OnSubmit before email box. It will work fine.

The validation facility is there for those people who want some simple user support. Even having that work across multiple sites and setup is tough.

Bob
Max_admin 09 Mar, 2008
Hi Vince, Bob,

The mootools validation file has some problem which is that it wouldn't handle the selection validation, new one is attached and it will be released with the new releases!

Cheers,

Max [file name=mooValidation.zip size=2752]http://www.chronoengine.com/components/com_fireboard/uploaded/files/mooValidation.zip[/file]<br><br>Post edited by: admin, at: 2008/03/09 16:15
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
d_proudfoot 11 Mar, 2008
I too am having validation problems
I downloaded the zip file and put the components/com_chronocontact/js/ directory. What else do I need to do to make it work? Thanks in advance.
GreyHead 11 Mar, 2008
Hi d_proudfoot,

Have you filled in the Validation tab?

Bob
d_proudfoot 12 Mar, 2008
Yes. I even recreated the form to see if that would solve things but it still does not work.
Max_admin 12 Mar, 2008
Hi,

The issue discussed here is that only the "selection" validation rule doesn't work, but all other works fine, is this the same case with you ? or just all validation doesn't work ?

Cheers,

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
d_proudfoot 12 Mar, 2008
Validation does not work at all. I am using Joomla 1.5. I see that there is a rc2 now since I installed. I will try that.
Max_admin 12 Mar, 2008
sure, try that and you may need to test with validation library as mootools😉
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
d_proudfoot 13 Mar, 2008
I have tried that but it still does not work. Joomla 1.5 with RC2.
Max_admin 13 Mar, 2008
This is really strange then, can you post a link to your website ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
d_proudfoot 13 Mar, 2008
http://www.londonskatingclub.com/home/index.php?option=com_chronocontact&chronoformname=Registration


<h1>Spring 2008 Registration</h1>
<h2>CanSkate and Preliminary Registration</h2>
This form is for Spring School 2008 taking place at Earl Nichols arena from April 14,2008 to June 6, 2008. Test Day: June 9, 2008 2008.<br>
All prices are in Candian dollars are are tax exempt.<br> 
Multiple skater registration discounts,use of vouchers, and out of club skater registrations are not available through online registration at this time.
Please note price for Preliminary skaters increases after April 9th. 
<table>

<tr>
 <td align=right>Skate Canada Number</td>
<td><input name="SkateCanadaNum"></td>
<td><Please enter the skater's Skate Canada Number if you know it.</td>
</tr>

<tr>
<td align=right>Skater's Name</td>
<td><input name="Bname"></td>
<td>Skaters first and last name.</td>

</tr>

<tr>
<td> </td>
<td><select name="Gender" style="font-size:12px; height:20; border: 1px solid #C0C0C0; background: #fff; width:150px">
  <option value="F">Female    </option>
  <option value="M">Male      </option>
  </select></td>
<td> </td>
</tr>

<tr>
<td align=right>Birth Date</td>
<td><input name="Birth"></td>
<td>Birth date dd/mm/yyyy.</td>

</tr>

<tr>
<td align=right>Address</td>
<td><input name="Baddress1"></td>
<td valign=top> </td>
</tr>

<tr>

<td align=right>City</td>
<td><input name="Bcity"></td>
<td valign=top> </td>
</tr>

<tr>

<td align=right>Postal Code</td>
<td><input name="Bpostalcode"></td>
<td valign=top> </td>
</tr>

<tr>
<td align=right>Phone</td>
<td><input name="phone"></td>
<td>Phone number including area code.</td>
</tr>

<tr>
<td align=right>Email</td>
<td><input name="email"></td>
<td>Confirmation of receipt of registration will be emailed to this address.</td>
</tr>

<tr>
<td align=right>Parent Name</td>
<td><input name="Sname"></td>
<td>First and last name of skater's parent or guardian.</td>

</tr>

<tr>
<td  align=right>Emergency Contact</td>
<td><input name="EmergencyName"></td>
<td>Name of person to be contacted in case of emergency.</td>
</tr>

<tr>
<td align=right>Emergency Phone</td>
<td><input name="EmergencyPhone"></td>
<td>Phone number for emergency contact.</td>
</tr>
<tr>
<td align=right>Level</td>
<td><input name="level"></td>
<td>Highest stage, badge or test passed.</td>
</tr>

<tr>
<td align=right>Notes</td>
<td colspan=2>Important medical inormation,special requests, etc</td>
</tr>

<tr>
<td align=right> </td>
<td colspan=2><textarea cols="50" rows="4" name="notes"></textarea></td>

</tr>


</table><table>
  
<?php 
global $database;
$database->setQuery( "SELECT * FROM jos_chronoforms_1 WHERE session='spring'ORDER BY cf_id;" );
if (!$database->query()) {
  echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>";
}
$rows = $database->loadObjectList();
foreach($rows as $row) {
  $thechoice = $row->cf_id;
  echo "<tr>
  <td align=right>
    <input type='checkbox' name='choice[]' value='$thechoice'>
  </td>
  <td>".$row->level." " .$row->day." ".$row->time."</td>
  <td> $".$row->price."</td></tr>";
}
?>
<tr><td align=right><input type='checkbox' name='SkateCanada' value='30'></td>
<td colspan=2><FONT COLOR="red">Add Skate Canada fees if not paid since September 1, 2007 ($30.00)</font></td></tr>

<tr><td colspan=3><input name="submit" value="Submit" type="submit"></td></tr>
</table>


Edited to break up long line<br><br>Post edited by: GreyHead, at: 2008/03/14 01:41
GreyHead 14 Mar, 2008
Hi d_proudfoot,

The immediate cause seems to be that the JS snippet after the form code isn't picking up the form name
var valid = new Validation('ChronoContact_', {immediate : true, onFormValidate : formCallback});
Why that should be is another question!

Bob

PS Toy also hava a stray < in "<Please enter the skater's Skate Canada Number if you know it."
This topic is locked and no more replies can be posted.