470,855 Members | 1,309 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

how is submit button appearance changed?

Hi,

Currently designing/building my first class/template driven site.

Inside a PHP form a list of article titles are displayed along with the
first two lines of the article. When the user clicks on the article title
the form with the list of article titles is replaced with the full text of
the article selected.

Since the article ID for the article title selected determines which article
will be displayed it would seems that if each title displayed (on the
article title list page) was actually a submit button. Of course I don't
want a list of gray submit boxes with titles lumbering down the page.

What I'd like to know is:

First, is it possible to assign a variable to a submit button. It seems like
it would be, but if someone has found a reason for not doing so I'd
appreciate hearing it.

Second, how do I change the image of the submit button so it appears as a
link (without the underline, of course). I've found a couple of tutorials in
regards to this issue, but they all had major typos and so far have not
gotten any of them to work. Any suggestions in this area will be of an
immense help.

Any suggestions or advice is greatly appreciated.

Richard
Jul 17 '05 #1
2 3101
Richard B. wrote:
Hi,

Currently designing/building my first class/template driven site.

Inside a PHP form a list of article titles are displayed along with the
first two lines of the article. When the user clicks on the article title
the form with the list of article titles is replaced with the full text of
the article selected.

Since the article ID for the article title selected determines which article
will be displayed it would seems that if each title displayed (on the
article title list page) was actually a submit button. Of course I don't
want a list of gray submit boxes with titles lumbering down the page.

What I'd like to know is:

First, is it possible to assign a variable to a submit button. It seems like
it would be, but if someone has found a reason for not doing so I'd
appreciate hearing it.

Second, how do I change the image of the submit button so it appears as a
link (without the underline, of course). I've found a couple of tutorials in
regards to this issue, but they all had major typos and so far have not
gotten any of them to work. Any suggestions in this area will be of an
immense help.

Any suggestions or advice is greatly appreciated.

Richard


Hi Richard,

To have a link act like a submit button do the following:

<a href="javascript:document.submit()" style="text-decoration:none">
My link
</a>

Buttons also have a variable associated with them and that is their name:

<input type="submit" name="myButton" value="Submit!">
<input type="submit" name="myButton" value="Skip">

So, in the file where you are processing the form you can use it as a
regular POST (or GET) variable:

if ($_POST["myButton"] == "Submit!")
print "hello";
else if ($_POST["myButton"] == "Skip")
print "skipping";
Jul 17 '05 #2
I noticed that Message-ID: <kc*******************@twister.socal.rr.com>
from Richard B. contained the following:
Second, how do I change the image of the submit button so it appears as a
link (without the underline, of course). I've found a couple of tutorials in
regards to this issue, but they all had major typos and so far have not
gotten any of them to work. Any suggestions in this area will be of an
immense help.


Why not make it a link, to the same page if needs be, and pass a
variable(or variables) in the URL? You can then style it with CSS how
you want.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by lsarg | last post: by
2 posts views Thread by Margaret Werdermann | last post: by
2 posts views Thread by Matt | last post: by
7 posts views Thread by David T. Ashley | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.