By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,080 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,080 IT Pros & Developers. It's quick & easy.

Images in place of <input type="submit"

P: n/a
I'm working with a CGI program that was using several standard buttons for
input using
<input type="submit" name="abuttonName" ...

Now, I'm trying to replace the standard buttons with images using an onClick
function.

For 1 button it's easy enough - document.forms[0].submit(); but how do I let
the CGI script know which one of the buttons were clicked?

THANKS!
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
news wrote:
I'm working with a CGI program that was using several standard buttons for
input using
<input type="submit" name="abuttonName" ...

Now, I'm trying to replace the standard buttons with images using an
onClick function.

For 1 button it's easy enough - document.forms[0].submit();


Eugh. So you don't want anyone who can't (or won't) use JavaScript to use
the form?

<http://www.theregister.co.uk/content/55/34186.html>

What's wrong with <input type='image' ...>? (OK, a fair bit, but less then
depending on scripting)

--
David Dorward http://dorward.me.uk/
Jul 20 '05 #2

P: n/a
"news" <St*****@LeagueofDesign.com> wrote in message
news:23***************************@msgid.meganewss ervers.com...
I'm working with a CGI program that was using several standard
buttons for input using
<input type="submit" name="abuttonName" ...

Now, I'm trying to replace the standard buttons with images using
an onClick function.
Don't, use <input type="image" name="abuttonName" src=" ... "> instead ,
you won't be able to do rollover effects in Netscape 4.n but will in
subsequent browsers.
For 1 button it's easy enough - document.forms[0].submit(); but
how do I let the CGI script know which one of the buttons were
clicked?


<input type="image"> buttons send information about the x and y
positions of the where they were clicked associated with the name of the
button so the CGI script will be able to tell which button was clicked.

Richard.
Jul 20 '05 #3

P: n/a
For a down and dirty work around ("kludge"). I'm currently using-

for the image button -
onClick="document.forms[0].Button1.click()"
onClick="document.forms[0].Button2.click()"
etc...
and then hiding the "real" buttons off of the visible area of the screen.
using-
<input type="submit" name="Button1"...
<input type="submit" name="Button2"...
etc...

It is *not* pretty, but it does work, since I have multiple <input
type="submit" buttons on the form that I'm trying to convert to a more
graphical interface.


Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.