Topic: Validation Question?
Hello, here is my test page http://tinyurl.com/ybdacc9
I've Done this page here http://www.thatagency.com/design-studio s-captcha/ and have the thank you message comming back to the same page using this post. http://www.webmaster-talk.com/php-forum ation.html
All works fine when JS is enabled, but I need some security aswell when JS is off. There is a lot to work out here, but as a start, how can I grab and clean this bit in bold
<script type="text/javascript">
$.validator.methods.equal = function(value, element, param) {
return value == param;
};
$(document).ready(function(){
$("#contactform").validate({
rules: {
name: "required",
email: {
required: true,
email: true
},
captcha: {
equal: <?php echo $randomNumTotal; ?>
}
},
messages: {
email: "",
name: "",
captcha: ""
}
});
});
</script>
and put and clean it here just below the form
<?php } else {
// email script
echo "Thanks, message received";
}?>
For clarification, here is my form, and you can see my JS in the head of the test page. Thanks!
<?php if(!$_POST){
?>
<form id="contactform" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<div>
<label for="name">Name</label>
<input type="text" id="name" name="name">
<label for="contact-email">Email</label>
<input type="text" id="email" name="email">
<label for="contact-message">Message</label>
<textarea id="contact-message" name="message" rows="3" cols="35"></textarea>
<input type="text" id="captcha" name="captcha" value="<?= $randomNum ?> + <?= $randomNum2 ?>" onFocus="clearText(this)" onBlur="clearText(this)">
<input type="submit" id="contact-login" value="">
</div>
</form>
<?php } else {
// email script
echo "Thanks, message received";
}?>
...OR if you can point me to a similar method I'm all ears. I've pretty much read all the web has to offer on the subject. I'm trying to work with the ones I can some what understand.
Last edited by Eric (2009-10-30 15:48:43)
