To reject on Like Entry
Instead of passing on Like Entry, how to reject on Like Entry. For example, there have been many bogus submissions where the values of First Name and Last Name fields are the same. How to accomplish this? Thanks.
Instead of passing on Like Entry, how to reject on Like Entry. For example, there have been many bogus submissions where the values of First Name and Last Name fields are the same. How to accomplish this? Thanks.
Are you using client or server validation?
I suppose you could do it with a little php...
Use required validation on :
<?php echo((isset($_POST['firstField']) && isset($_POST['lastField']) && strtoupper($_POST['lastField']) == strtoupper($_POST['firstField']))?"fail":""); ?>
that should fail required validaiton if the two fields were the same... just a warning though... I knew a kid named "Jackson Jackson" in high school.
How can I do this same thing with client side validation? Basically it would allow an update or insert only if 2 fields DO NOT MATCH. Is there any way to make 'Like Entry' behaves as 'Not Like Entry'
Specifically, i want to prevent a user from creating cheque requisitions for himself as the recipient. Their own user id is automatically captured, and they input the recipient. I compare both fields, and don't want to allow if they match.
Help?
When you apply like entry validatin, it creates the following function in the script tag:
function WAValidateLE(formElement,value1,value2,errorMsg,focusIt,stopIt,required) {
var isValid = true;
if (!document.WAFV_Stop && !formElement.WAFV_Stop) {
if (value1=="" && required)
isValid = false;
if (value1 != value2 || (required && value1==""))
isValid = false;
}
if (!isValid) {
if (focusIt)
focusIt.value = "";
WAAddError(formElement,errorMsg,focusIt,stopIt);
}
}
if you change that to:
function WAValidateLE(formElement,value1,value2,errorMsg,focusIt,stopIt,required) {
var isValid = true;
if (!document.WAFV_Stop && !formElement.WAFV_Stop) {
if (value1=="" && required)
isValid = false;
if (value1 == value2 || (required && value1==""))
isValid = false;
}
if (!isValid) {
if (focusIt)
focusIt.value = "";
WAAddError(formElement,errorMsg,focusIt,stopIt);
}
}
it will reverse it to fail if the two values are the same.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.