View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Adding Checkboxes to Form

Thread began 5/07/2009 7:54 pm by jurinski334466 | Last modified 5/26/2009 4:26 pm by jurinski334466 | 39087 views | 18 replies

jurinski334466

Hi Ray,

Thanks yet again. You have been very helpful. Progress is being made. When things don't work, I fall back on shifting code around hoping to hit on something that does work with mixed results.

1. The checkboxes are now sticky. Per your suggestion, this is the code that worked:

Checkbox Field code:
<tr>
<td colspan="2" class="bluexxs">
<label>
<input <?php if (!(strcmp((ValidatedField("regis","course1")),"course1"))) {echo "checked=\"checked\"";} ?> <?php echo(ValidatedField("regis","course1")) ?> name="course1" type="checkbox" id="course1" value="course1" />
</label>
</td>

However, I'm getting confused in the all the details. Do I need both php statements?
I would really appreciate help debugging the page. Is there a way to privately send you the link?

Even more Questions....
2. Email Field Question:
I used the email field and code from the WA contact form field. It does not seem to be set up to allow uppercase entrys; i.e. "MYNAME@THIS.COM" Validation balks at the ".COM" Is this the way the email validation works or is it the result of some screwball changes I made? What change where, do I need to make to create a more forgiving validation? I don't want someone to have to go back and reenter the email info just because they left the caps lock on. Or am I missing something?

Email Field code:
<tr>
<td colspan="4"><div align="right" class="formtext"><span class="star">*</span>Your
E-mail:</div></td>
<td colspan="3"><span id="sprytextfield2">
<label>
<input name="Email_Address" type="text" class="inputValue" id="Email_Address" onblur="if (document.getElementById('emailServerError')) document.getElementById('emailServerError').style.display='none'" value="<?php echo(ValidatedField("regis","Email_Address")) ?>" size="25" maxlength="35"/>
</label>
</span> </td>
<td colspan="7"><span class="textfieldRequiredMsg"><span class="error_message2">Please enter a valid email.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
<?php
if (ValidatedField("regis","regis")) {
if ((strpos((",".ValidatedField("regis","regis").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<span id="emailServerError" class="textfieldServerError"><span class="error_message2">Please enter your email address so we<br />
may confirm your registration.</span></span>
<?php //WAFV_Conditional regis.php regis(2:)
}
}
}?></td>
</tr>

3. Phone Field Question:
I added a spry formatting hint to the Phone text field which is not a required field. Is there a way to prevent the hint text from submitting?

Phone Field code:
<tr>
<td colspan="4"><div align="right" class="formtext">Phone #:</div></td>
<td colspan="3"><span id="sprytextfield5">
<label>
<input name="Phone" type="text" class="inputValue" id="Phone" value="555-555-5555" onFocus="if(this.value=='555-555-5555')this.value='<?php echo(ValidatedField("regis","Phone")) ?>" size="12" maxlength="12" />
<span class="textfieldInvalidFormatMsg"><span class="error_message2">Example: 123-456-7890.</span></span></label>
</span></td>
<td colspan="6"><span class="textfieldInvalidFormatMsg"><span class="error_message2">Enter phone number as 555-555-5555.</span></span>
<?php
if (ValidatedField("regis","regis")) {
if ((strpos((",".ValidatedField("regis","regis").","), "," . "8" . ",") !== false || "8" == "")) {
if (!(false)) {
?>
<span class="error_message2">Enter phone number as 555-555-5555.</span>
<?php //WAFV_Conditional regis.php regis(8:)
}
}
}?></td>
</tr>

4. Non-Required Fields:
The address fields are not required and can be submitted blank. I followed the example of the contact and email fields. The code works and the information passes to the email, but I'm unsure whether it's the correct way to do it. Should the target value for the "value=" be the php ValidatedField value?

Address field code:
<tr>
<td colspan="4"><div align="right" class="formtext">Address #1:</div></td>
<td colspan="3"><label>
<input name="Address1" type="text" class="inputValue" id="Address1" value="<?php echo(ValidatedField("regis","Address1")) ?>" size="25" maxlength="50" />
</label> </td>
<td colspan="7">&nbsp;</td>
</tr>

5. I also still have my checkbox validation question still on the horizon but am trying to get the rest of the form in order before facing into that one. Thank you again for following up on all my long-winded questions and helping me sort out my confusion.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...