Forums

Validation 1-required not working?????

webmonkiee 17 Jan, 2008
I'm going crazy. I've used Chonoforms on a few other sites, and had no problem with validation.

This is the first site I've used it in J! 1.0

The validation is only working on 11 - validate-selection

It is not working for 1 - required (not blank) or any of the others. I don't see anything out of the ordinary on my form or in my J! template.

I am using the "prototype" validation library because MooTools is not working.

Any thoughts? My form can be seen here

And here is my form code. Nothing crazy just add some js to populate one of the fields. I've tried it without that js with the same results...
<script src="scripts/cities.js" type="text/javascript" ></script>
<h3>I Want to Sell My Land</h3>
<p>Are you considering selling your land? Fill in this form and Land22 will contact you with an estimate of the value of your property:</p>

<div class="form_header">
	<h4 class="contact">Contact Details</h4>
</div>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="form">
	<tr>
		<td class="left" valign="top">First Name:</td>
		<td class="right" valign="top"><input class="inputbox" type="text" name="fname" id="fname" maxlength="100" size="30" tabindex="1" style="width:240px" /> *Required</td>
	</tr>
    <tr>
		<td class="left" valign="top">Last Name:</td>
		<td class="right" valign="top"><input class="inputbox" type="text" name="lname" maxlength="100" size="30" tabindex="2" style="width:240px" /> *Required</td>
	</tr>
	<tr>
		<td class="left" valign="top">Email:</td>
		<td class="right" valign="top"><input class="inputbox" type="text" name="email" maxlength="100" size="30" tabindex="3" style="width:240px" /> *Required</td>
	</tr>
    <tr>
		<td class="left" valign="top">Day Phone:</td>
		<td class="right" valign="top"><input class="inputbox" type="text" name="dphone" maxlength="100" size="30" tabindex="4" style="width:240px" /> *Required</td>
	</tr>
	
	<tr>
		<td class="left" valign="top">Parcel Number (APN):</td>
		<td class="right" valign="top"><input class="inputbox" type="text" name="parcel_number" maxlength="100" size="30" tabindex="5" style="width:240px" /> *Required</td>
	</tr>
	<tr>
		<td class="left" valign="top">Parcel County:</td>
		<td class="right" valign="top">
        <select tabindex="6" name="parcel_county" class="inputbox" onChange="fillSelectFromArray(this.form.sub_products, ((this.selectedIndex == -1) ? null : modelinfo[this.selectedIndex-1]));" style="width:250px">
        	<option value="">Select a County</option>
            <option value="san_diego">San Diego</option>
            <option value="riverside">Riverside</option>
            <option value="san_bernadino">San Bernadino</option>
        </select></td>
	</tr>
    <tr>
		<td class="left" valign="top">Parcel City:</td>
		<td class="right" valign="top">
        	<select name="sub_products" id="sub_products" size="10" class="inputbox" tabindex="7" style="width:250px" >
                <option> </option>
            </select>
        </td>
	</tr>
    <tr>
		<td class="left" valign="top">Parcel Electricity:</td>
		<td class="right" valign="top">
        <select name="parcel_electric" tabindex="8" style="width:250px">
        	<option value="">Select an option</option>
            <option value="meter_installed">Electric meter installed</option>
            <option value="street_next_to">Electricity in street next to property</option>
            <option value="elec_general_area">Electricity in general area</option>
            <option value="no_electric">No electricity available</option>
            <option value="elec_dont_know">Don't know</option>
        </select>
        </td>
	</tr>
    <tr>
		<td class="left" valign="top">Parcel Water:</td>
		<td class="right" valign="top">
        <select name="parcel_water" tabindex="9" style="width:250px" >
        	<option value="">Select an option</option>
        	<option value="well_on_property">Well on property</option>
            <option value="water_meter">Water meter installed</option>
            <option value="water_next_to">District water in street next to property</option>
            <option value="water_general_area">District water in general area</option>
            <option value="no_water">No water available</option>
            <option value="elec_dont_know">Don't know</option>
        </select>
        </td>
	</tr>
    <tr>
		<td class="spanned" colspan="2" valign="top">I am considering listing my land for sale with Land22:<br>
		<label><input type="radio" name="interested_list" value="yes" id="RadioGroup1_0">Yes</label>  <label><input type="radio" name="interested_list" value="no" id="RadioGroup1_1"> No</label></td>
	</tr>
    <tr>
		<td class="spanned" colspan="2" valign="top">I may be interested in selling my land directly to Land22:<br>
		<label><input type="radio" name="interested_sell" value="yes" id="RadioGroup1_0">Yes</label>  <label><input type="radio" name="interested_sell" value="no" id="RadioGroup1_1"> No</label></td>
	</tr>
    <tr>
		<td class="left" valign="top">Comments:</td>
		<td class="right" valign="top">
        	<textarea name="comments" cols="" rows="" class="inputWidth" tabindex="10" style="width:250px"></textarea>
      	</td>
	</tr>
    <tr>
		<td style="text-align:center;padding-bottom:10px;" valign="top">
        <input type="image" src="images/M_images/submit_btn.gif" name="submit" value="submit" class="button" />
        </td>
        <td> </td>
	</tr>
</table>


Edited to change url tag<br><br>Post edited by: GreyHead, at: 2008/01/17 07:25
GreyHead 17 Jan, 2008
Hi webmonkiee,

I think the problem is that you have 'class="inputbox" in your input fields. If you look at the page source code you'll see that these don't show as 'class="required"' which they need to for the validation to work. ChronoForms just isn't clever enough to merge the two class fields into one.

You'll find a suggested fix in this thread.

Bob

PS I also notice that some of your style attributes are missing the semicolons eg style="width:250px" should be style="width:250px;" this could cause problems with some browsers.
webmonkiee 18 Jan, 2008
Thanks!

I always thought you didn't need the semi-colon if it was the last attribute in the style. Thanks!
GreyHead 18 Jan, 2008
Hi webmonkiee,

You are correct, sorry. Here's a note from Eric Meyer's CSS Definitive Guide "While it's not technically necessary to follow the last declaration of a rule with a semicolon, it is generally good practice to do so. . . ."

Bob
This topic is locked and no more replies can be posted.