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

Image Button and Post Method Help

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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.