Hi,
I've got a page using ASP to save user input to a database. Anyway the page worked fine, but now if a user tries to copy and paste text from MS Word into my field and submit nothing happends... the page doesn't even try to submit.
The form goes to the validate javasscript onSubmit so I'm wondering whether the cobmination of copied text from word and my validate script is preventing the page from submitting... can someone have a look at my javascript validation script? It's originally from these boards i think... sorry can't remember who
Cheers
I've got a page using ASP to save user input to a database. Anyway the page worked fine, but now if a user tries to copy and paste text from MS Word into my field and submit nothing happends... the page doesn't even try to submit.
The form goes to the validate javasscript onSubmit so I'm wondering whether the cobmination of copied text from word and my validate script is preventing the page from submitting... can someone have a look at my javascript validation script? It's originally from these boards i think... sorry can't remember who
Code:
<style>.errorcolor {background: ffaaaa}</style>
<style>.goodcolor {background: ffffff}</style>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
tempobj.className='goodcolor';
if (tempobj.name.substring(0,3)=="req") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
}
}
}
}
if (!pass) {
shortFieldName=tempobj.name.substring(3,30).toUpperCase();
alert("Please make sure the "+shortFieldName+" field was properly completed (Highlighted in red).");
tempobj.className='errorcolor';
return false;
}
else
return true;
}
// End -->
</script>
Cheers