This my script code:
Expand|Select|Wrap|Line Numbers
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- function validate(frm)
- {
- if (frm.lb_dept.value.length == 0)
- {
- alert("Please enter a Requestors Department.")
- frm.lb_dept.focus()
- return false
- }
- if (frm.lb_sub_dept.value.length == 0)
- {
- alert("Please enter a Requestors Sub-Departmen.")
- frm.lb_sub_dept.focus()
- return false
- }
- if (frm.lb_type.value.length == 0)
- {
- alert("Please enter a Request Type.")
- frm.lb_type.focus()
- return false
- }
- if (frm.lb_priority.value.length == 0)
- {
- alert("Please enter a Request Priority.")
- frm.lb_priority.focus()
- return false
- }
- if (frm.target_date.value.length == 0)
- {
- alert("Please enter a Target Date .")
- frm.target_date.focus()
- return false
- }
- }
- //-->
- </SCRIPT>
This is the first line of my form:
[HTML]<form id="logcallform" name="logcallform" method="POST" onsubmit="return validate(logcallform)" action="php/xmlhttp/logcall.submit.php">[/HTML]
My validation function never seems to get called!
I am a not 100% sure if I can leave the action tag in the form of if I need to put that in an else tag within the validation code?
Any help is much appreciated.