mcolton
08-23-2009, 11:17 AM
I have some field checking on forms that works great but it won't validate in xhtml strict. I get errors about the "&"
What's the trick around this. I tried "&&" and that didn't work.
Below is partial code:
<script type="text/javascript">
function validate() {
mNv10=dogadoptionform.own.value;
mNv11=dogadoptionform.permission.value;
if (!(dogadoptionform.own[0].checked || dogadoptionform.own[1].checked)) {
alert('Own/Rent is a required question.');
event.returnValue=false;
}
if ((!(dogadoptionform.permission[0].checked || dogadoptionform.permission[1].checked)) && dogadoptionform.own[0].checked) {
alert('Landlords permission is a required question.');
event.returnValue=false;
}
.......
</script>
What's the trick around this. I tried "&&" and that didn't work.
Below is partial code:
<script type="text/javascript">
function validate() {
mNv10=dogadoptionform.own.value;
mNv11=dogadoptionform.permission.value;
if (!(dogadoptionform.own[0].checked || dogadoptionform.own[1].checked)) {
alert('Own/Rent is a required question.');
event.returnValue=false;
}
if ((!(dogadoptionform.permission[0].checked || dogadoptionform.permission[1].checked)) && dogadoptionform.own[0].checked) {
alert('Landlords permission is a required question.');
event.returnValue=false;
}
.......
</script>