Jump to content


Photo

IE and <input type="button">


  • Please log in to reply
5 replies to this topic

#1 Phil

Phil

    Force Majeure

  • Network Leaders
  • 7,976 posts
  • Location:Switzerland
  • Projects:Revora, C&C:Online
  •  Thought Police
  • Division:Revora
  • Job:Network Leader
  • Donated
  • Association

Posted 06 July 2007 - 09:48 PM

Okay, I've been working on my web project when I noticed that the whole system is really buggy with IE (and I'm not even speaking of the CSS issues).
The problem is that no link with a button inside* will work in IE6 nor in IE7. Now I wonder if there's some simple HTML trick to fix this or if I need to rely on JavaScript or CSS (to reformat my buttons/links) to fix this issue.

(*Hopes that somebody visits this forum in the next few years*)

* Code example:
<a href="http://blablabla.bla" title="blabla"><input type="button" value="Click me!" /></a>

revorapresident.jpg
My Political Compass

Sieben Elefanten hatte Herr Dschin
Und da war dann noch der achte.
Sieben waren wild und der achte war zahm
Und der achte war's, der sie bewachte.


#2 Blodo

Blodo

    The one who disagrees

  • Project Team
  • 3,002 posts
  • Location:Eastern Europe
  • Projects:siteMeister, Mental Omega
  •  The wise guy

Posted 06 July 2007 - 11:36 PM

Isn't it easier to emulate the windows button look on an A using css? You won't be able to slap a link on a form button without using JS and having it work everywhere.

ARGUMENT FROM CREATION, a.k.a. ARGUMENT FROM PERSONAL INCREDULITY (I)
(1) If evolution is false, then creationism is true, and therefore God exists.
(2) Evolution can't be true, since I lack the mental capacity to understand it; moreover, to accept its truth would cause me to be uncomfortable.
(3) Therefore, God exists.


#3 Phil

Phil

    Force Majeure

  • Network Leaders
  • 7,976 posts
  • Location:Switzerland
  • Projects:Revora, C&C:Online
  •  Thought Police
  • Division:Revora
  • Job:Network Leader
  • Donated
  • Association

Posted 07 July 2007 - 09:54 AM

Ah, too bad. I thought this was the way to go to keep some of the links like the other standard form buttons. I guess I'll redesign all the buttons anyway then. Gotta hate IE :p

revorapresident.jpg
My Political Compass

Sieben Elefanten hatte Herr Dschin
Und da war dann noch der achte.
Sieben waren wild und der achte war zahm
Und der achte war's, der sie bewachte.


#4 CodeCat

CodeCat

    Half fox, half cat, and all insanity!

  • Members
  • 3,768 posts
  •  Fighting for equality of all species

Posted 07 July 2007 - 02:17 PM

<input type="button" value="Click me!" onclick="location = 'http://blablabla.bla';" />

That's how I'd do it. I don't know why relying on JS is such a bad thing really...

Alternatively, this might seem a bit hacky but it works:

<form action="http://blablabla.bla" method="get">
<input type="submit" value="Click me!" />
</form>
CodeCat

Posted Image
Posted Image

#5 Phil

Phil

    Force Majeure

  • Network Leaders
  • 7,976 posts
  • Location:Switzerland
  • Projects:Revora, C&C:Online
  •  Thought Police
  • Division:Revora
  • Job:Network Leader
  • Donated
  • Association

Posted 07 July 2007 - 04:02 PM

I thought of the form method too, but that would leave me with a lot of tagsoup because I'd need a bit many hidden fields to pass on all the other parameters (like page= etc).

And from my point of view JS is cool, as long as it's not a necessary part for the functionality. Meaning all the important parts should work with JavaScript turned off aswell.
So unless there is a short HTML-based fix for it, I'll go with a CSS button redesign.

Thanks for the good ideas though :lol:

revorapresident.jpg
My Political Compass

Sieben Elefanten hatte Herr Dschin
Und da war dann noch der achte.
Sieben waren wild und der achte war zahm
Und der achte war's, der sie bewachte.


#6 Jeeves

Jeeves

    I write the interwebz

  • Members
  • 4,156 posts
  •  Friendly neighborhood standards Nazi

Posted 12 July 2007 - 11:16 AM

I like avoiding JS too, else I'd go with
<input type="button" value="Click me!" onclick="window.location.href='http://foo.bar'" />
As it is, I'd go with CSS. Buttons are ugly and a b*tch to style anyway :p

World Domination Status: 2.7%





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users