close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Creating Unvalidated Check Boxes

Thread began 10/16/2009 2:27 pm by susan358933 | Last modified 10/20/2009 11:46 am by Jason Byrnes | 2931 views | 6 replies |

susan358933

Creating Unvalidated Check Boxes

Hello,

I'm having problems adding check boxes to the Contact Form Solution pack. I don't want them to be "required/validated" fields - just optional information.

I've read the support forum, followed threads for jurinski334466 etc. but they all seem to relate to validated fields.

1) I've replaced the "Comments" field on the "out of the box" contact.php form with two check boxes.

<label for="Preflight" >Please send me these documents:</label>
<br />

<span id="sprycheckbox3">

<label>
<input type="checkbox" name="preflight" value="preflight"/>Pre-flight Checklist
<input type="checkbox" name="redesign" value="redesign"/>Redesign Checklist

<?php //WAFV_Conditional contact.php contact(3:)

?>

2) I've removed this line of code from top of page (referring to "Comments")

$WAFV_Errors .= WAValidateRQ(((isset($_POST["Comments"]))?$_POST["Comments"]:"") . "",true,3);

I did NOT include any new code as I don't need an error message for check box fields.


3) I've removed this line of code at bottom of page (referring to "Comments")

var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {validateOn:["blur"]});


Replaced with:

var sprycheckbox3 = new Spry.Widget.ValidationCheckbox("sprycheckbox3");


When I click on the "submit" button nothing happens. The page reloads and a new security image is displayed.

Here's a link to form.

contactRADIO.php

FYI: the "out of the box" form works fine on my server here:

contact.php

Can you provide the code for adding a non-validated radio box?

That is, I'm not requiring that clients fill in the check boxes.

Sign in to reply to this post

Jason ByrnesWebAssist

I dont think you need to add:
var sprycheckbox3 = new Spry.Widget.ValidationCheckbox("sprycheckbox3");


to trouble shoot what the problem is, find the following code:
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}



and change it to:
if ($WAFV_Errors != "") {
die($WAFV_Errors);
PostResult($WAFV_Redirect,$WAFV_Errors,"contact");
}




if a validation error is occurring, this will cause the page to display a comma seperated list of numbers corresponding to the validation that is failing.

post this back with a copy of the form page so I can take a look.

Sign in to reply to this post

susan358933

Validation Code - failing ,2

Hi Jason,

I completed the two changes you requested and reloaded the contact form.

I then completed the form and submitted.

Here are the results:

,2

You can find the updated form at:

contactRADIO.php

Many thanks,

Susan

Sign in to reply to this post

Jason ByrnesWebAssist

Can you compress the php page in a zip archive and attach that to your reply so I can look at the code.

Sign in to reply to this post

susan358933

File attached for Check Box

Hi Jason,

I've attached the .zip file on the contact.php form.

Thank you.

Susan

Attached Files
contact.php.zip
Sign in to reply to this post

susan358933

Correct file for check boxes

Jason,

Please disregard first .zip file.

The correct one contactRADIO.php.zip is the one.

SORRY about that...

Susan

Attached Files
contactRADIO.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

So the die statement results are saying that validation 2 is failing:

  Here are the results:

,2  



validation 2 is the email validation

php:
$WAFV_Errors .= WAValidateEM(((isset($_POST["Email_address"]))?$_POST["Email_address"]:"") . "",true,2);




make sure you entering a properly formatted email address in the email address form field.

Sign in to reply to this post

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...