send to email address

wxdqz

New Member
hi

just wondering how i submit a validated form to an email address. do you need to use formmail??

also the focus doesnt seem to be working properly in this script, when you dont enter something it simply just goes to the top of the page without selecting any input box that wasnt filled out.

here is my code:


<SCRIPT LANGUAGE="javascript">

<!--Script for checking that there are at least two referees-->

<!--
function submitted() {
g=document.applicationreferees;
if(g.disagree.checked==true && g.agree.checked==true){
alert("You cant tick both boxes!");
} else if(g.disagree.checked==true){
alert("We are unable to submit your application!")
} else if(g.disagree.checked==false && g.agree.checked==false){
alert("You havent selected a box!");
} else if(g.referee1.value==""){
alert("You must enter your first referee!");
g.referee1.focus();
} else if(g.company1.value==""){
alert("You must fill in the name of the company!");
g.company1.focus();
} else if(g.phone1.value==""){
alert("You must fill in your previous company's phone number!");
g.phone1.focus();
} else if(g.referee2.value==""){
alert("You must fill in a second referee!");
g.referee2.focus();
} else if(g.company2.value==""){
alert("You must fill in the name of the company!");
g.company2.focus();
} else if(g.phone2.value==""){
alert("You must fill in your previous company's phone number!");
g.phone2.focus();
} else {
alert("Your information has been submitted!")
}
}

//-->
</SCRIPT>


<!--Start of form-->

<form name="applicationreferees" >

<center><h2>Employment Applications <i>cont.</i></h2></center>

<br>

<h3>4. Referees</h3>

<br>

<h4>Please list at least two recent professional referees.</h4>

<h4>Referee 1.</h4>

<!--Table 1-->

<table width="81%">

<tr>
<td>Name of Referee:
<td><input type="text" id="referee1" size="25" /> *
</tr>

<tr>
<td>Company (If applicable):
<td><input type="text" id="company1" size="25" /> *
</tr>

<tr>
<td>Current Phone Number:
<td><input type="text" id="phone1" size="25" /> *
</tr>

</table>

<!--End of table 1-->

<br>
<h4>Referee 2.</h4>

<!--Table 2-->

<table width="81%">

<tr>
<td>Name of Referee:
<td><input type="text" id="referee2" size="25" /> *
</tr>

<tr>
<td>Company (If applicable):
<td><input type="text" id="company2" size="25" /> *
</tr>

<tr>
<td>Current Phone Number:
<td><input type="text" id="phone2" size="25" /> *
</tr>

</table>

<!--End of table 2-->

<br>
<h4>Referee 3.</h4>

<!--Table 3-->

<table width="81%">

<tr>
<td>Name of Referee:
<td><input type="text" id="referee" size="25" />
</tr>

<tr>
<td>Company (If applicable):
<td><input type="text" id="referee" size="25" />
</tr>

<tr>
<td>Current Phone Number:
<td><input type="text" id="referee" size="25" />
</tr>

</table>

<!--End of table 3-->

<center>
<input type="checkbox" id="disagree" value=http://www.webdeveloper.com/forum/archive/index.php/"declaration" />Disagree
<input type="checkbox" id="agree" value="declaration" />I agree

<br>
<br>

<input type="submit" value="Submit" name="applications" align="right" onClick="submitted()" />
</center>

</form>

<!--End of form-->

any help would be much appreciated!
 
Back
Top