469,336 Members | 5,276 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

Image Button and Post Method Help

I'm trying to use an image as a submit button - I'm reading Sams Teach
Yourself HTML and the chapter on this doesn't show me the details on
how this is done - I mean I can't seem to see it or grasp how this
works?

I see the tag for the image and I assume I need a form get or post
line but how are the two connected so the clicking on the image button
activates the post method?

Thanks...

Jul 16 '05 #1
5 12399
RG

"Ralph Freshour" <ra***@primemail.com> wrote in message
news:ek********************************@4ax.com...
I'm trying to use an image as a submit button - I'm reading Sams Teach
Yourself HTML and the chapter on this doesn't show me the details on
how this is done - I mean I can't seem to see it or grasp how this
works?

I see the tag for the image and I assume I need a form get or post
line but how are the two connected so the clicking on the image button
activates the post method?

Thanks...

<input type="image" border="0" src="images/login.gif" alt="Trade Login">
RG


Jul 16 '05 #2

"Ralph Freshour" <ra***@primemail.com> wrote in message:
news:ek********************************@4ax.com...
I'm trying to use an image as a submit button - I'm reading Sams Teach
Yourself HTML and the chapter on this doesn't show me the details on
how this is done - I mean I can't seem to see it or grasp how this
works?

I see the tag for the image and I assume I need a form get or post
line but how are the two connected so the clicking on the image button
activates the post method?

Thanks...


I hope this will work for you:

<a href="javascript:document.formname.submit()">
<img src='button.gif' alt='button' border=0></a>

-
Kindest Regards,
Olexiy Merenkov
http://www.merenkov.com/olexiy
Jul 16 '05 #3
I don't understand what this js code does:

<a href="javascript:document.formname.submit()">

Don't I need a method post statement in my form?
I have several graphical image 'buttons' - when the form is submitted
how will the called .php script know which 'button' was clicked on?
On Tue, 5 Aug 2003 13:04:27 +0300, "???????? ??????? ???????"
<al**@zaporizhstal.com> wrote:

"Ralph Freshour" <ra***@primemail.com> wrote in message:
news:ek********************************@4ax.com.. .
I'm trying to use an image as a submit button - I'm reading Sams Teach
Yourself HTML and the chapter on this doesn't show me the details on
how this is done - I mean I can't seem to see it or grasp how this
works?

I see the tag for the image and I assume I need a form get or post
line but how are the two connected so the clicking on the image button
activates the post method?

Thanks...


I hope this will work for you:

<a href="javascript:document.formname.submit()">
<img src='button.gif' alt='button' border=0></a>

-
Kindest Regards,
Olexiy Merenkov
http://www.merenkov.com/olexiy


Jul 16 '05 #4
Ralph Freshour <ra***@primemail.com> writes:
<al**@zaporizhstal.com> wrote:
"Ralph Freshour" <ra***@primemail.com> wrote in message:
I'm trying to use an image as a submit button - I'm reading Sams Teach
I hope this will work for you:
It doesn't work for me.
<a href="javascript:document.formname.submit()">
<img src='button.gif' alt='button' border=0></a>


I don't understand what this js code does:

<a href="javascript:document.formname.submit()">


It, in browsers with Javascript enabled, possibly submits the form
where the opening <form> tag has the name attribute name="formname".

In browsers with Javascript disabled it does absolutely nothing, apart
from really winding up the user when they discover the form won't
submit. This is a bigger problem with longer forms.

For a better solution, you should read
http://www.cs.tut.fi/~jkorpela/forms/index.html
and especially
http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
Don't I need a method post statement in my form?
<form method="post" action="submittothis.php">

You don't necessarily need it, forms *can* be submitted with 'get'
instead, though whether you *should* or not depends on what the form does.
I have several graphical image 'buttons' - when the form is submitted
how will the called .php script know which 'button' was clicked on?


http://ppewww.ph.gla.ac.uk/%7eflavell/www/trysub.html

--
Chris
Jul 16 '05 #5
OK, I got it to work and now when I click on one of my image 'buttons'
I can detect which one - however, now I'm reading and trying to see
how to call the correct php script based on what was clicked on.

On my home page I call via post method a dispatch.php script and in
that script I detect which button was clicked on - how do I just call
another php script? For example, if I click on Create I would need to
call the create.php script, if I click on Delete I need to call
delete.php

Thanks...
On Tue, 5 Aug 2003 08:46:32 -0700, "RG" <Me@NotTellingYa.com> wrote:

"Ralph Freshour" <ra***@primemail.com> wrote in message
news:ek********************************@4ax.com.. .
I'm trying to use an image as a submit button - I'm reading Sams Teach
Yourself HTML and the chapter on this doesn't show me the details on
how this is done - I mean I can't seem to see it or grasp how this
works?

I see the tag for the image and I assume I need a form get or post
line but how are the two connected so the clicking on the image button
activates the post method?

Thanks...

<input type="image" border="0" src="images/login.gif" alt="Trade Login">
RG


Jul 16 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Matt | last post: by
15 posts views Thread by Anand Ganesh | last post: by
4 posts views Thread by David W. Simmonds | last post: by
7 posts views Thread by lgbjr | last post: by
1 post views Thread by Chuck Anderson | last post: by
2 posts views Thread by smokeyd | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.