webmarkart
11-04-2002, 09:47 PM
Yes, I've already searched the forum and all of the pertinant posts didn;t really resolve this question. I want to use an image in place of the typical sumbit and reset buttons.
Here is the code I am using:
<SCRIPT LANGUAGE="JavaScript">
<!--
function validateForm()
{
if(document.form1.SEARCH_BY.value == "")
{
alert("Please Enter a Search Term");
document.form1.SEARCH_BY.focus();
}
else
{
document.form1.submit();
}
}
//-->
</SCRIPT>
<FORM ACTION="default.asp?action=searchlist" NAME="form1">
<P><INPUT TYPE="text" NAME="SEARCH_BY" VALUE="" SIZE="18" MAXLENGTH="50">
<A HREF="javascript:validateForm()"><img src="images/go.gif" alt="" width="15" height="15" border="0"></A></P>
</FORM>
the action is default.asp?action=searchlist and on that page I am Trim Requesting the variable "SEARCH_BY". Instead of going to this page however it submits to default.asp?SEARCH_BY=test.
I've also tried <input type="image" action="submit" src="images/go.gif">
and <input type="image" action="submit" src="images/go.gif" alt="Go" name="Go" width="15" height="15">
nothing seems to work. Try the seach yourself: www.webmarkart.com/because (on the bottom right).
Here is the code I am using:
<SCRIPT LANGUAGE="JavaScript">
<!--
function validateForm()
{
if(document.form1.SEARCH_BY.value == "")
{
alert("Please Enter a Search Term");
document.form1.SEARCH_BY.focus();
}
else
{
document.form1.submit();
}
}
//-->
</SCRIPT>
<FORM ACTION="default.asp?action=searchlist" NAME="form1">
<P><INPUT TYPE="text" NAME="SEARCH_BY" VALUE="" SIZE="18" MAXLENGTH="50">
<A HREF="javascript:validateForm()"><img src="images/go.gif" alt="" width="15" height="15" border="0"></A></P>
</FORM>
the action is default.asp?action=searchlist and on that page I am Trim Requesting the variable "SEARCH_BY". Instead of going to this page however it submits to default.asp?SEARCH_BY=test.
I've also tried <input type="image" action="submit" src="images/go.gif">
and <input type="image" action="submit" src="images/go.gif" alt="Go" name="Go" width="15" height="15">
nothing seems to work. Try the seach yourself: www.webmarkart.com/because (on the bottom right).