function checkEmail(fieldValue){ var chkAt = fieldValue.indexOf("@"); var chkDot= fieldValue.indexOf("."); var chkHack= fieldValue.indexOf("@."); var chkHackA= fieldValue.indexOf(".@"); if((chkAt >= 0) && (chkDot >= 0) && (chkHack == -1) && (chkHackA == -1) ) { return true; } return false; } /* function validate_contact(form) { msg = ""; if (form.first_name.value == ''){ msg += "Vorname\n"; alert(msg); eval('form.first_name.focus()'); return false; } if (form.last_name.value == ''){ msg += "Nachname\n"; alert(msg); eval('form.last_name.focus()'); return false; } if (form.email.value == ''){ msg += "E-Mail\n"; alert(msg); eval('form.email.focus()'); return false; }else if (!checkEmail(form.email.value)){ msg += "E-Mail (Invalid Id)\n"; alert(msg); eval('form.email.focus()'); return false; } if (form.my_concern.value == ''){ msg += "Dein Anliegen\n"; alert(msg); eval('form.my_concern.focus()'); return false; } } */ function empty_form(form){ form.first_name.value = ""; form.last_name.value = ""; form.email.value = ""; form.my_concern.value = ""; return false; } function checkSelected(form) { var radiosize = form.size; var sizeflag = 0; for (i=0; i< radiosize.length && sizeflag==0; i++){ if (radiosize[i].checked){ sizeflag = 1; }else{ sizeflag = 0; } } if (sizeflag == 0){ alert ('Please select a size'); return false; } var colorflag = 0; var radiocolor = form.color; for (i=0; i< radiocolor.length && colorflag==0; i++){ if (radiocolor[i].checked){ colorflag = 1; }else{ colorflag = 0; } } if (colorflag == 0){ alert ('Please select a color'); return false; } }