473,654 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3236
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="javascrip t:document.subm it()" 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
12399
by: lsarg | last post by:
i've been trying forever to figure out a way to use a regular text link in place of a submit button at the bottom of this. can't get it. i'm just starting to learn php, so i'm stuck. any help at all would be amazing. <?php # Script 12.7 - login.php // This is the login page for the site. // Include the configuration file for error management and such.
4
4291
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field that has been modified/clicked the form doesn't always submit. When it does work, a Stored procedure is passed form variables and updates to the db are made. When it doesn't, its as if the form wasn't submitted, it reloads and resets the page, but...
4
7786
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM: The form won't submit if the link is clicked, but will submit if the SUBMIT button is clicked. I need to call a function to change the form's action according to user's input before it is submitted.
2
4892
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I had to add a JavaScript function to the Submit button to make a server function run when the form was submitted. Unfortunately, this JavaScript wouldn't run when the button was designated as a Submit, so I changed the button and placed a...
2
3496
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button with image populate.gif? When I click p1 or p2 button, it will post the page to process.asp. 2) When I check the checkbox, I want the image in submit button change from populate.gif to validate.gif. Unfortunately, the code InputForm.p2.src =...
1
1853
by: melanieab | last post by:
Hi again, With much help, I've finally gotten the Tab key to be recognized when a textbox is in focus, but now I'm having trouble with the up/down keys when they're focused on a custom button (on KeyDown, when I ask to show keyCode, nothing happens (except for Enter) so the focus goes to some textboxes that should never receive focus). I can think of 3 options, but don't know how to do any of them: 1) Say that these textboxes should...
10
3027
by: Perry van Kuppeveld | last post by:
Hi, I have a problem with formatting a table including text fields wich can contain up to 255 chars. I need a table with 3 columns: - First column 50 % over the with a rowspan of the total number of rows. - Second column 25 %, no rowspan - Third column 25 %, no rowspan
7
2360
by: David T. Ashley | last post by:
Hi, For a web page, I want a SUBMIT button that commits the form data and a CANCEL button that goes to a different target (i.e. a different script). I haven't figured out how to do this, because the <FORM ACTION="... tag seems to make sure that any two submit controls in a form have to go to the same target. BTW, the CANCEL button does not have to submit any form data.
5
2269
by: WestAussie | last post by:
Hello I'm new to .NET and have been working through some exercises to get a bit more fluent. I have no idea what I have done to cause command buttons to have their background appearance changed. This has happened to all previous programs as well that I have gone back over and checked, yet when I created them the command button style was different. Originally the background of the command button was one colour (light blue from memory)...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.