dulciew
10-22-2002, 05:32 AM
I have this code that when the link is clicked, the text boxes are cleared and the cursor appears in the Amount textbox, but the focus won't focus and I don't know what the problem is. Can someone help. Thanks. PS I have all the breaks in because the form is supposed to be at another part of the page.
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
function doMort( ) {
document.MortCalc.Amount.focus( )
document.MortCalc.Amount.value=" ";
document.MortCalc.Rate.value=" ";
document.MortCalc.Years.value=" ";
document.MortCalc.Payment.value=" ";
}
</SCRIPT>
</HEAD>
<BODY>
<DIV align=center><A href="#LoanCalc" onClick=doMort()>Estimate Mortgage Payment</A>
</DIV>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<A name=LoanCalc>
<H3 align=center>Estimate Mortgage Payments</H3>
<CENTER></A><BR>
<TABLE>
<FORM name=MortCalc>
<TBODY>
<TR>
<TD>Amount of Mortgage:</TD>
<TD><INPUT size=9 value=" " name=Amount></TD></TR>
<TR>
<TD>Interest Rate as % (e.g. 7.9):</TD>
<TD><INPUT size=9 value=" " name=Rate></TD></TR>
<TR>
<TD>Number of Years:</TD>
<TD><INPUT size=9 value=" " name=Years></TD></TR>
<TR>
<TD>Monthly Payment:</TD>
<TD><INPUT size=12 value=" " name=Payment></TD></TR>
<TR>
<TD><INPUT type=button value=Calculate> <INPUT type=reset value=Reset></TD></TR></TBODY></TABLE></FORM></CENTER>
<HR>
<BR><BR></BODY></HTML>:(
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
function doMort( ) {
document.MortCalc.Amount.focus( )
document.MortCalc.Amount.value=" ";
document.MortCalc.Rate.value=" ";
document.MortCalc.Years.value=" ";
document.MortCalc.Payment.value=" ";
}
</SCRIPT>
</HEAD>
<BODY>
<DIV align=center><A href="#LoanCalc" onClick=doMort()>Estimate Mortgage Payment</A>
</DIV>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<A name=LoanCalc>
<H3 align=center>Estimate Mortgage Payments</H3>
<CENTER></A><BR>
<TABLE>
<FORM name=MortCalc>
<TBODY>
<TR>
<TD>Amount of Mortgage:</TD>
<TD><INPUT size=9 value=" " name=Amount></TD></TR>
<TR>
<TD>Interest Rate as % (e.g. 7.9):</TD>
<TD><INPUT size=9 value=" " name=Rate></TD></TR>
<TR>
<TD>Number of Years:</TD>
<TD><INPUT size=9 value=" " name=Years></TD></TR>
<TR>
<TD>Monthly Payment:</TD>
<TD><INPUT size=12 value=" " name=Payment></TD></TR>
<TR>
<TD><INPUT type=button value=Calculate> <INPUT type=reset value=Reset></TD></TR></TBODY></TABLE></FORM></CENTER>
<HR>
<BR><BR></BODY></HTML>:(