input type="image" submit probls
Hi Everyone
I'm hoping you can help me.
I'm a total beginner so please be patient.
I have a form like this.
- <<form action="index.php?_a=tellafriend&productId={PRODUCT_ID}" target="_self" method="post">
<table border="0" cellspacing="0" cellpadding="3" id="TAFriend">
<tr>
<td align="right"><strong>{TXT_RECIP_NAME}</strong></td>
<td><input type="text" name="recipName" value="{VAL_RECIP_NAME}" class="textbox" /></td>
</tr>
<tr>
<td align="right"><strong>{TXT_RECIP_EMAIL}</strong></td>
<td><input type="text" name="recipEmail" value="{VAL_RECIP_EMAIL}" class="textbox" /></td>
</tr>
<tr>
<td align="right"><strong>{TXT_SENDER_NAME}</strong></td>
<td><input type="text" name="senderName" class="textbox" value="{VAL_SENDER_NAME}" /></td>
</tr>
<tr>
<td align="right"><strong>{TXT_SENDER_EMAIL}</strong></td>
<td><input type="text" name="senderEmail" class="textbox" value="{VAL_SENDER_EMAIL}" /></td>
</tr>
<!-- BEGIN: spambot -->
<tr>
<td align="right" valign="bottom"><strong>{TXT_SPAMBOT}</strong></td>
<td><p>{IMG_SPAMBOT}</p>
<input name="spamcode" type="text" class="textbox" value="" size="5" maxlength="5" /></td></tr>
<!-- END: spambot -->
<!-- BEGIN: recaptcha -->
<tr>
<td align="right" valign="top"><strong>{TXT_SPAMBOT}</strong></td>
<td>{FILE "content/recaptcha.tpl"}</td>
</tr>
<!-- END: recaptcha -->
<tr>
<td align="right" valign="top"><strong>{TXT_MESSAGE}</strong></td>
<td><textarea name="message" cols="30" rows="5" class="textbox">{VAL_MESSAGE}</textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="image" src="skins/{VAL_SKIN}/styleImages/buttons/reviewbtn-off.gif" name="submit" alt="{LANG_SUBMIT}" /></td>
</tr>
</table>
<input name="ESC" type="hidden" value="{VAL_ESC}" />
</form>
I've been using these for quite some time now to swap over the images and i feel quite comfortable with it.
- jQuery(function($) {
$('input[type="image"]').hover(
function () { $(this).attr("src", $(this).attr("src").split('-off').join('-on')); },
function () { $(this).attr("src", $(this).attr("src").split('-on').join('-off')); }
);
My problem is that i have an error which dynamically shows up if not all fields have been entered. It works fine in Firefox but not in IE or Opera. *edited to say* ok after much reading i now understand why this is happening.
"value from the button does not get passed onto the server". I'm going to take a stab here and say that its probably because the form doesn't know that the input type="image" is a submit button?
If so can i do anything with jquery that will let the form know that input type="image" is a submit button?
Much appreciated.
Thank-you :)
Jess