Images in place of <input type="submit"

N

news

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!
 
D

David Dorward

news said:
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)
 
R

Richard Cornford

news said:
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.
 
S

Stephen Ingrum

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top