laurenced
05-24-2005, 04:00 PM
Hi all, I'm using an emailer script and I can't get an image to work as a submit button instead of a normal HTML button.
Here's my code for the form:
<form name="mailman" id="mailman" method="post" action="">
<table border="0" cellpadding=2 cellspacing=0>
<tr>
<td width="120" align=right class="contentBlue"><b>Your name:</b></td>
<td align=left><input type=text id="name" name="name" class="mailInput">
<font class="smallRed">*</font></td>
</tr>
<tr>
<td width="120" align=right class="contentBlue"><b>Your e-mail:</b></td>
<td align=left><input type=text id="email" name="email" class="mailInput">
<font class="smallRed">*</font></td>
</tr>
<tr>
<td width="120" align=right class="contentBlue"><b>Your telephone:</b></td>
<td align=left><input type=number id="telephone" name="telephone" class="mailInput">
<font class="smallRed">*</font></td>
</tr>
<tr valign=top>
<td width="120" align=right class="contentBlue"><b>Mailing address:</b></td>
<td align=left><textarea id="mailaddress" name="mailaddress" cols=30 rows=2 class="mailInput"></textarea></td>
</tr>
<tr valign=top>
<td width="120" align=right class="contentBlue"><b>Message:</b></td>
<td align=left><textarea id="message" name="msg" cols=60 rows=4 class="mailInput"></textarea>
<font class="smallRed">*</font></td>
</tr>
<tr valign=top>
<td width="120"></td>
<td align=right><font class="smallRed">* required fields</font></td>
</tr>
<tr valign=top>
<td width="120"></td>
<td align=left><a href="javascript:document.mailman.submit();"><img src="/images/sendMessage.gif"></a><INPUT id="submit" type="image" name="submit" src="images/sendMessage.gif" border="0" alt="Submit"></td>
</tr>
</table>
</form>
and it doesn't work. I've also tried this method:
<INPUT TYPE="IMAGE" SRC="/images/sendMessage.giff" ALT="Submit" BORDER="0">
but it doesn't work either. The page just reloads and none of the validation (or indeed the sending) in my PHP script works (the script works fine with an ordinary HTML button, by the way, so it's not the script that is broken here).
The java console in Firefox says 'document.mailman.sender has no properties'. I don't know what this means because there's no element called 'sender' anywhere on the page.
Any help would be much appreciated.
Laurence
Here's my code for the form:
<form name="mailman" id="mailman" method="post" action="">
<table border="0" cellpadding=2 cellspacing=0>
<tr>
<td width="120" align=right class="contentBlue"><b>Your name:</b></td>
<td align=left><input type=text id="name" name="name" class="mailInput">
<font class="smallRed">*</font></td>
</tr>
<tr>
<td width="120" align=right class="contentBlue"><b>Your e-mail:</b></td>
<td align=left><input type=text id="email" name="email" class="mailInput">
<font class="smallRed">*</font></td>
</tr>
<tr>
<td width="120" align=right class="contentBlue"><b>Your telephone:</b></td>
<td align=left><input type=number id="telephone" name="telephone" class="mailInput">
<font class="smallRed">*</font></td>
</tr>
<tr valign=top>
<td width="120" align=right class="contentBlue"><b>Mailing address:</b></td>
<td align=left><textarea id="mailaddress" name="mailaddress" cols=30 rows=2 class="mailInput"></textarea></td>
</tr>
<tr valign=top>
<td width="120" align=right class="contentBlue"><b>Message:</b></td>
<td align=left><textarea id="message" name="msg" cols=60 rows=4 class="mailInput"></textarea>
<font class="smallRed">*</font></td>
</tr>
<tr valign=top>
<td width="120"></td>
<td align=right><font class="smallRed">* required fields</font></td>
</tr>
<tr valign=top>
<td width="120"></td>
<td align=left><a href="javascript:document.mailman.submit();"><img src="/images/sendMessage.gif"></a><INPUT id="submit" type="image" name="submit" src="images/sendMessage.gif" border="0" alt="Submit"></td>
</tr>
</table>
</form>
and it doesn't work. I've also tried this method:
<INPUT TYPE="IMAGE" SRC="/images/sendMessage.giff" ALT="Submit" BORDER="0">
but it doesn't work either. The page just reloads and none of the validation (or indeed the sending) in my PHP script works (the script works fine with an ordinary HTML button, by the way, so it's not the script that is broken here).
The java console in Firefox says 'document.mailman.sender has no properties'. I don't know what this means because there's no element called 'sender' anywhere on the page.
Any help would be much appreciated.
Laurence