SmileyFace
Programmer
I would really appreciate help with this....
I have a form on a page which has an image called 'Save' to submit it. This image currently calls another function called 'fsubmit' on the page which validates the form before submitting it. I need to use the 'Enter/Return' key to subit the form. Thus I cannot use the usual form submit as it doesn't have a parameter 'action' which sends it directly to another page.
So basically I need to be able ot use the 'Enter' key to submit a form where the submit button is an image which calls another function on the same page. PLEASE HELP. If there is a way to do this without using an image thats fine too. Thanks a lot in advance. Heres how some of the code looks...
-------This is part of a VBScript-------------------------
sub fReset
window.frmHouseHold.reset
end sub
sub fSubmit
if validform then
<%if ActionToTake = "I" then%>
window.frmHouseHold.action = "HouseHoldEdit_Action.asp?fx=I"
<%else%>
window.frmHouseHold.action = "HouseHoldEdit_Action.asp?fx=U&household_id=<%=HouseHoldID%>"
<%end if%>
window.frmHouseHold.submit
end if
end sub
-----------------------------------------------------------
-------This is the form------------------------------------
<form id="frmHouseHold" name="frmHouseHold" method="post">
<table border="0" cellpadding="2" cellspacing="0">
<tr valign="middle">
<td><font face="Arial" size="2" color="#FFFFFF"><b>Address</b></font></td>
<td><input type="text" name="txtAddress1" size="35" maxlength="35" value="<%=txtaddress1%>"></td>
</tr>
<tr valign="middle">
<td></td>
<td><input type="text" name="txtAddress2" size="35" maxlength="35" value="<%=txtaddress2%>"></td>
</tr>
<tr valign="middle">
<td><font face="Arial" size="2" color="#FFFFFF"><b>City</b></font></td>
<td><input type="text" name="txtCity" size="20" maxlength="20" value="<%=txtCity%>"></td>
</tr>
<tr valign="middle">
<td align="right" colspan="2">
<img border="0" src="../../images/btnSave.jpg" onclick="fsubmit()" style="cursor:hand">
<img border="0" src="../../images/btnReset.jpg" onclick="freset()" style="cursor:hand">
</td>
</tr>
------------------------------------------------------------
I have a form on a page which has an image called 'Save' to submit it. This image currently calls another function called 'fsubmit' on the page which validates the form before submitting it. I need to use the 'Enter/Return' key to subit the form. Thus I cannot use the usual form submit as it doesn't have a parameter 'action' which sends it directly to another page.
So basically I need to be able ot use the 'Enter' key to submit a form where the submit button is an image which calls another function on the same page. PLEASE HELP. If there is a way to do this without using an image thats fine too. Thanks a lot in advance. Heres how some of the code looks...
-------This is part of a VBScript-------------------------
sub fReset
window.frmHouseHold.reset
end sub
sub fSubmit
if validform then
<%if ActionToTake = "I" then%>
window.frmHouseHold.action = "HouseHoldEdit_Action.asp?fx=I"
<%else%>
window.frmHouseHold.action = "HouseHoldEdit_Action.asp?fx=U&household_id=<%=HouseHoldID%>"
<%end if%>
window.frmHouseHold.submit
end if
end sub
-----------------------------------------------------------
-------This is the form------------------------------------
<form id="frmHouseHold" name="frmHouseHold" method="post">
<table border="0" cellpadding="2" cellspacing="0">
<tr valign="middle">
<td><font face="Arial" size="2" color="#FFFFFF"><b>Address</b></font></td>
<td><input type="text" name="txtAddress1" size="35" maxlength="35" value="<%=txtaddress1%>"></td>
</tr>
<tr valign="middle">
<td></td>
<td><input type="text" name="txtAddress2" size="35" maxlength="35" value="<%=txtaddress2%>"></td>
</tr>
<tr valign="middle">
<td><font face="Arial" size="2" color="#FFFFFF"><b>City</b></font></td>
<td><input type="text" name="txtCity" size="20" maxlength="20" value="<%=txtCity%>"></td>
</tr>
<tr valign="middle">
<td align="right" colspan="2">
<img border="0" src="../../images/btnSave.jpg" onclick="fsubmit()" style="cursor:hand">
<img border="0" src="../../images/btnReset.jpg" onclick="freset()" style="cursor:hand">
</td>
</tr>
------------------------------------------------------------