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

Actually, after seeing the rest of the replies I've realised that this is something that I had to deal with myself a while back.

The way I got around it was (as has been suggested) to assign individual names to each INPUT control. In my case, I was using arrow images as sorting buttons. The code to render the HTML was a little like so:

print qq(<input type="image" name="sort:$field:asc" src="$image_dir/do +wn.png">);
The above was within a for loop, where the value of $field was changed on each iteration, to produce a unique name for each "button".

I had about 20 of these little "sorting" buttons on my page, so when it came to working out which one had been clicked (if any), I did this:

my ($sort_string) = grep { $_ =~ /^sort/ } @params; my ($sort_field, $sort_dir) = defined($sort_string) ? $sort_string =~ /^sort:(\w+):(\w+)/ : qw(avin desc);

The above worked fine in both IE and Firefox.

Hope this helps,
Darren :)

Replies are listed 'Best First'.
Re^2: <INPUT type="image"> problem with IE browser
by soon_j (Scribe) on May 23, 2006 at 01:36 UTC
    This one's very simple, yet clever approach. I'll implement this in my subsequent routine when necessary.

    <input type="image" name="submit" src="./images/Login-button.gif" value="Login" alt="Submit Button"/>