Unlesss you want one function to run straight into the other after calling the first one....?
In which case you need to call the second one to run (provided that ran the first one..).
Assuming this is the case, why not this?
Code:
<script language = "JavaScript">
<!--
function mail() {
var theFields = document.concernform.elements;
var x = theFields["MyTeacher"].value;
if (x == "Other (Support Staff etc)")
{
theFields["MyEmail"].value = "";
}
else
if (x == "AAS - Mr A Adams")
{
theFields["MyEmail"].value = "aadams@wickersley.net";
}
headmail();
}
function headmail() {
var theFields = document.concernform.elements;
var y = theFields["MyDepartment"].value;
if (y == "Careers")
theFields["MyHeademail"].value = "Careers";
else
if (y == "Maths")
theFields["MyHeadmail"].value = "Maths";
}
//-->
</script>

Last edited by BravoGolf : 09-14-2004 at 05:49 AM.
|