LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2008, 01:07 AM   #1
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
html buttons and diffwerent browsers


Code:
<tr><td class="rowheader" colspan="2">
<a href="timetable_view.php?id=2"><input class="btn" type="button" name="add" value="View timetable" tabindex="5"></a>
<input class="btn" type="button" name="add" value="View timetable" onclick="window.location='timetable_view.php?id=2';" tabindex="6">
</td></tr>
The above code has two buttons that load another webpage when a user clicks them. One uses <a></a> tags and the other one javascript.

I'm trying to make the pages functional when a browser does not support javascript (or the user has disabled it) and therefore prefer the first form. The problem is that IE (v6) does not (seem to) like that form; it displays the url in the statusbar when the mouse is over the button but clicking does not take me there.

Did I miss something? Any solution (except for not using a button)?
 
Old 09-25-2008, 02:37 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
One way is to submit the form the buttons are in, and having the (php?) page that the data is sent to check which button was pressed and push the user to the appropriate page. On the page that receives the form data you simply check if "add" was set (with isset()) and if it is, you know the add button was clicked. Or if you don't prefer an extra page, set the action to be the same php page the form is in, and have it check for received values (and acting upon them) before printing the buttons etc. (which should happen if no data was received).
 
Old 09-25-2008, 11:50 PM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Original Poster
Rep: Reputation: 282Reputation: 282Reputation: 282
Thanks Bouncer

I know that I can do that. They are indeed part of a form (which has an additional button for a 'real' submit), but I don't want them to go to the same page as that button. That would imply extra code (not a big issue) and a redirection (makes it slower)

I can give them their own (dummy) form, but that gives me some issues with layout as the first form has a width that depends on the content while the dummy form would not as the content is fixed.

WimS
 
Old 09-26-2008, 07:11 AM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Use an image for the button, with an url link, problem solved
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Comparison Between Linux Web Browsers - Review of 5 Linux Browsers LXer Syndicated Linux News 0 05-17-2008 01:21 PM
Mouse back and forward buttons are interpreted as buttons 2 and 3 (MX610) jot-87 Linux - Hardware 1 08-06-2007 11:12 AM
Help binding mouse buttons to keyboard buttons Eckstona Linux - Hardware 6 09-24-2006 07:28 AM
html?? XFS?? XFRee? Browsers? serious problem countcobolt Linux - Software 0 09-28-2003 04:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration