Forum Moderators: open

Message Too Old, No Replies

very frustrating: input type="image" problem

         

willg825

12:42 pm on Sep 23, 2005 (gmt 0)

10+ Year Member



So, I've been pretty frustrated by this for a while -

I have a form that submits perfectly in Firefox. The final submission is <input type="image"> It connects to a credit card validator, and then comes back with the result, exactly the way it should.

IE, however, doesnt do it - it submits to the CC validator (i get all the confirmation emails, db submissions etc.,) but the page displayed is the *original* page of the form (this is how it should work, if for example the user clicks 'refresh' right after submitting). The form works perfectly if I make the <input type="submit" for IE - but when its input type="image", it does this double-submit thing. ITs not a double click issue - i've tried onDblClick events, as well as the onClick double-click checkers; something is happening where IE is submitting the form twice, firefox is not, and it works when input type="submit"

briefly, the submit code is:

<input name="stepthree" value="stepthree" type="image" src="/images/btn_submit.jpg" onclick="document.forms['finalForm'].submit();">

<input type="submit" name="submitit" value="yes">

thoughts anyone? (for reference, its php-based, though Im not sure if thats releveant)

thanks in advance,

will

dcrombie

1:23 pm on Sep 23, 2005 (gmt 0)



The default action of input type="image" is to submit the form. You've added an onClick handler that also submits the form. The event handler also has no return value. That's probably where the problem begins...

willg825

1:34 pm on Sep 23, 2005 (gmt 0)

10+ Year Member



That would do it.

I wonder why Firefox would only submit once, though.

Regardless its all set. Thanks a bunch..