in reply to <INPUT type="image"> problem with IE browser

It's a problem with IE. It simply does not send the values of the image buttons. I have a workaround for that, but it relies on Javascript:
<form action="/blabla" method="post"> <input type="hidden" name="mypage" id="mypage" value="" /> <input type="image" name="page" value="1" src="/static/images/suchen +.gif" onclick="document.getElementById('mypage').value='1';" /> <input type="image" name="page" value="2" src="/static/images/suchen +.gif" onclick="document.getElementById('mypage').value='2';" /> ... </form>
and later in the script:
$page = $cgi->param('page') || $cgi->param('mypage') || 1;


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: <INPUT type="image"> problem with IE browser
by davorg (Chancellor) on May 18, 2006 at 09:19 UTC
    It's a problem with IE

    I think that's overstating the case. IE is doing exactly what it should be doing. Firefox has added some new and useful behaviour. But it's non-standard* and IE can't be expected to support it.

    * Or, at least, I can't find any standards that mandate the Firefox behaviour.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re^2: <INPUT type="image"> problem with IE browser
by soon_j (Scribe) on May 19, 2006 at 03:38 UTC
    Thanks for your inputs guys! I made it to work using this workaround:
    <TD> <INPUT type="hidden" name="page"> </TD> <TD> <A href="javascript:do_Submit(1)"><IMG src="page1.gif" ...></A> <A href="javascript:do_Submit(2)"><IMG src="page2.gif" ...></A> <A href="javascript:do_Submit(3)"><IMG src="page3.gif" ...></A> <A href="javascript:do_Submit(4)"><IMG src="page4.gif" ...></A> ... <A href="javascript:do_Submit(50)"><IMG src="page50.gif" ...></A> </TD>
    The on the javascript:
    function do_Submit(page) { var page; document.forms[0].page.value = page; document.forms[0].submit(); }
    I also confirmed that this wasn't supported in the HTML specs. I just assumed too much when I made the code. But I wasn't able to catch it soon enough since I am always using Firefox