Forums

Required Fields not being required [SOLVED]

stirfry213 23 Apr, 2009
Hello, I have Joomla 1.5.8 and Chronoforms V3.1 RC4.11

In my form, chronoforms is not requiring data to be in the field even tho I have it set to be required. The problem might be for how I've chopped the code up from the pregenerate code the wizard gives. Here's what I am using:
<center>
<p>
<b>CADDO MINERALS<br>
SERVICE REQUEST FORM</b>
</p>
<p>
PLEASE FILL OUT THE FOLLOWING INFORMATION SO THAT WE MAY ASSIST YOU
</p>
</center>
<table align="center">
	<tr>
		<td valign="top"><b>1.</b></td>
		<td valign="top"><b>YOUR CONTACT INFORMATION</b> (So we may get back to you)</td>
	</tr>
	<tr>
		<td></td>
		<td>
			<table>
				<tr>
					<td valign="top">Your Name</td>
					<td valign="top"><input class="cf_inputbox required" maxlength="150" size="30" title="Your Name" id="text_0" name="text_0" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">Email (or phone number and time to contact you)</td>
					<td valign="top"><input class="cf_inputbox required" maxlength="150" size="30" title="Email" id="text_1" name="text_1" type="text" /></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="top"><b>2.</b></td>
		<td valign="top"><b>PROPERTY DESCRIPTION</b></td>
	</tr>
	<tr>
		<td></td>
		<td>
			<table>
				<tr>
					<td valign="top">Total Acres <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_2" name="text_2" type="text" /> Ownership Interest %<input class="cf_inputbox" maxlength="150" size="10" title="" id="text_3" name="text_3" type="text" onChange="valuevalidation(this,0,100,'Interest must be between 100 and 0');" /> Do you own the surface? <input value="radio 1" title="" class="radio" id="radio00" name="radio0" type="radio" /><label for="radio00" class="radio_label">Yes</label><input value="radio 2" title="" class="radio" id="radio01" name="radio0" type="radio" /><label for="radio01" class="radio_label">No</label></td>
				</tr>
				<tr>
					<td valign="top">Location: Section <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_4" name="text_4" type="text" /> Township <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_5" name="text_5" type="text" /> Range <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_6" name="text_6" type="text" /> OR</td>
				</tr>
				<tr>
					<td valign="top">Survey <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_7" name="text_7" type="text" /> Abstract <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_8" name="text_8" type="text" /> OR</td>
				</tr>
				<tr>
					<td valign="top">Section <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_9" name="text_9" type="text" /> Block <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_10" name="text_10" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">County or Parish <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_11" name="text_11" type="text" /> State <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_12" name="text_12" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">Is there a Mineral Servitude? If so, please describe</td>
				</tr>
				<tr>
					<td valign="top"><TEXTAREA class=cf_inputbox id=text_13 name=text_13 rows=3 cols=50></TEXTAREA></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="top"><b>3.</b></td>
		<td valign="top"><b>LEASE INFORMATION</b></td>
	</tr>
	<tr>
		<td></td>
		<td>
			<table>
				<tr>
					<td valign="top">Is your land presently leased? <input value="radio 3" title="" class="radio" id="radio02" name="radio1" type="radio" /><label for="radio02" class="radio_label">Yes</label><input value="radio 4" title="" class="radio" id="radio03" name="radio1" type="radio" /><label for="radio03" class="radio_label">No</label> If Yes, we need to know the following:</td>
				</tr>
				<tr>
					<td valign="top">Lessor name (this is probably you) <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_14" name="text_14" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">Lessee name (this is the oil company) <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_15" name="text_15" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">Date of the Lease <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_16" name="text_16" type="text" /> Term (years) <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_17" name="text_17" type="text" /> Extension (years) <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_18" name="text_18" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">Royalty %<input class="cf_inputbox" maxlength="150" size="10" title="" id="text_19" name="text_19" type="text" onChange="valuevalidation(this,0,100,'Interest must be between 100 and 0');" /> Recording Information Vol <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_20" name="text_20" type="text" /> Page <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_21" name="text_21" type="text" /> Ref No <input class="cf_inputbox" maxlength="150" size="10" title="" id="text_22" name="text_22" type="text" /></td>
				</tr>
				<tr>
					<td valign="top">Is there presently production on the land? <input value="radio 5" title="" class="radio" id="radio04" name="radio2" type="radio" /><label for="radio04" class="radio_label">Yes</label><input value="radio 6" title="" class="radio" id="radio05" name="radio2" type="radio" /><label for="radio05" class="radio_label">No</label></td>
				</tr>
				<tr>
					<td valign="top">If Yes, please identify the well</td>
				</tr>
				<tr>
					<td valign="top"><TEXTAREA class=cf_inputbox id=text_23 name=text_23 rows=3 cols=50></TEXTAREA></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="top"><b>4.</b></td>
		<td valign="top"><b>SERVICE REQUEST</b> (What do you want us to do? Check those that apply)</td>
	</tr>
	<tr>
		<td></td>
		<td>
			<table>
				<tr>
					<td valign="top">
								<input value="Check 1" title="" class="radio validate-one-required" id="check00" name="check0[]" type="checkbox" />
      <label for="check00" class="check_label">I want you to help me lease my land!</LABEL><BR>
								<input value="Check 2" title="" class="radio validate-one-required" id="check01" name="check0[]" type="checkbox" />
      <label for="check01" class="check_label">Make me an offer for ½ of my royalty interest</LABEL><BR>
								<input value="Check 3" title="" class="radio validate-one-required" id="check02" name="check0[]" type="checkbox" />
      <label for="check02" class="check_label">I want to "Ask a Landman" the following question</LABEL>
					</td>
				</tr>
				<tr>
					<td valign="top"><TEXTAREA class=cf_inputbox id=text_24 name=text_24 rows=3 cols=50></TEXTAREA></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<center>
<p>
THANK YOU FOR YOUR REQUEST.  WE WILL GET BACK TO YOU WITHIN 3 BUSINESS DAYS<br />
<div class="form_item">
  <div class="form_element cf_button">
    <input value="CLICK HERE TO SUBMIT THIS REQUEST" type="submit" />
  </div>
  <div class="clear"> </div>
</div>
</p>
</center>

Here's what Chronoforms auto generates for a required field:
<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label">Required</label>
    <input class="cf_inputbox required" maxlength="150" size="30" title="" id="text_0" name="text_0" type="text" />
  
  </div>
  <div class="clear"> </div>
</div>

If any part of the pregenerated code is required (other than the <input> code) please let me know, but as it sits, my form will not require the first 2 fields or the checkbox fields at the bottom. Any help would be greatful. Thank you.
GreyHead 23 Apr, 2009
Hi stirfry213,

I don't see anything wrong with your code - ChronoForms *should* validate that OK.

Bob
stirfry213 23 Apr, 2009
Unfortunately, it doesn't work even tho the code looks good. Here's the link to my form:
REMOVED LINK

Now, here's a test form I made on the same site to see if I was having any type of conflict. I let the wizard create the form, then I stripped down the code similar to my form. Of course, it works, so it didn't help me any. Here is a link and the code:
REMOVED LINK
Name <INPUT class="cf_inputbox required" id=text_0 maxLength=150 size=30 name=text_0><br />
<INPUT type=submit value=Submit>


Keep in mind, this second form works as expected, requiring the field to have data in it before it will submit the form.

The question is, why does the test form work, but not mine? My form has 28 unique fields, is that too many? Is my html code messing with the validation?
stirfry213 24 Apr, 2009
I would also like to add that I made another test form allowing the wizard to create the whole form with out any html editing at all.
REMOVED LINK
It works, but it looks... well... aweful.

I would still love to know what about my original form does chronoforms not like.
stirfry213 24 Apr, 2009
I found the problem!

When the wizard creates the form, it automatically enables "Load Chronoforms CSS/JS Files" option. When you create a form manually, like I did, this option is turned off by default. I turned it on and BAM, everything works.

To find this option, you needs to click on a form to edit it in the backend. Under the General Tab, the option is there.
This topic is locked and no more replies can be posted.