close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Customize the Validation PHP code and adding to my own form?

Thread began 10/26/2009 12:56 pm by carlene | Last modified 10/26/2009 4:34 pm by Jason Byrnes | 3336 views | 5 replies |

carleneBeta Tester

Customize the Validation PHP code and adding to my own form?

Hello!
I've followed the instructions for adding the Captcha to my own form and it's working just fine. I'd like to add the PHP Validation to my own form as well, but am a little confused as to what to do here.
For Example:
With this code from lines 82 -94 of sample_contactus.php :
<input name="seconddblock" id="seconddblock" type="text" style="display:none" value="" />
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<span id="emailServerError" class="textfieldServerError">Please provide your email addess so we can get back in touch with you.</span>
<?php //WAFV_Conditional contact.php contact(2:)
}
}
}?>

Is "seconddblock" defined in the CSS SpryValidationTextField.css or the SpryValidationTextarea.css? Does this have to be form specific and need to be in there? I'm using my own form formatting. Also what does "contact" refer to? (That isn't the id of the sample_contactus.php form.) And what does php //WAFV_Conditional contact.php contact(2:) refer to?

Just trying to reverse engineer this PHP code and I guess I need it a little more spelled out.

I'm also wondering if there is more explanation for customization or for the PHP code in any of the documentation? Am I missing something?

Thanks!

Carlene

Sign in to reply to this post

Jason ByrnesWebAssist

addblock is not used by the spry validation.

it is a validation technique called HoneyPots.

it is a hidden form element that is validated to be empty.

The idea is that a robot hijacking your form will assume that all form elements need to be filled out and submit the form with a value added to the addblock form element causing validation to fail.

It only has to be there if the Server Side validation include the regular expression validation for the addblock field.


This:
//WAFV_Conditional contact.php contact(2:)

Is a comment. it means that the validation show if region is for validatin #2 from the contact.php page.

instead of trying to reverse engineer the code, you could just use the Server Validation functions of the CSS form builder tool.

Sign in to reply to this post

carleneBeta Tester

Oh sorry, I don't have the CSS Form Builder tool. I have the Contact Form Solution pack! Just trying to work within this solution and make it work on my form.

So - I either have to just use the entire form provided in the solution pack - or nothing? There's no further documentation on customizing the Validation available?

I have the Validation Toolkit extension but it adds way too much javascript to my page! Just trying to get my code to be a little leaner.

Sign in to reply to this post

Jason ByrnesWebAssist

You can use the validation toolkit extension as well. CSS Form builder is version 2 of validation toolkit.

it will only add javascript to your page if you use client side validation. using server side validation will only add php code.

we do not support hand coding what the tool can already do.

Sign in to reply to this post

carleneBeta Tester

OH - I see. So do I have that available to download for free then if I purchased the Validation Toolkit? I'm confused about this...

Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

Server Validation is part of validation toolkit.

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