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

how is submit button appearance changed?

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


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

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