• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html:link wraps a button but not on IE

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following snippet in my JSP page:

This code works fine in Firefox but fails in IE. When I say "fail" I mean nothing at all happens (save for a hiccup on the button). If I swap the comments, the link works in both browsers. The rendered HTML in the view source is identical for both. Is this behavior fallout from the browser wars or am I overlooking something fundamental? I really would prefer to use a button as opposed to an image. Is there some other way to do this so it works in any browser?

Thanks to all who reply ...
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand the idea of an image inside a link tag, but a button seems odd. I am wondering if this is valid html. Is your button wrapped in an html:form or form tag? If you want a button, then you are probably better off using some java script in the onclick event. Or you can use an html:submit tag and submit the page on the click.

- Brent
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you declare the HTML version you're using at the top of the document? If not, try it, and see if this fixes it.

Example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
Andre LeDuc
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do have the DOCTYPE statement included but it makes no difference.

This is the welcome page to a site and all it is is static text detailing how the site works - instructions basically, so there is no form per se, and no request parameters. I code the action attribute on <html:link> to forward directly to a org.apache.struts.Action instance that does app setup. The reason I'm wrapping a button in a link is because I don't have the time to create the images and for right now, the buttons give me glyphs as a proxy for proper images. For this iteration of the app, all I want to do is get something in front of the users so they can verify that I have all the right stuff in the right places so we can make any major content, navigation and business logic changes earlier rather than later. Later on I'll go back and style the pages and create the images. Truth is though, I struggle with technologies like CSS and PhotoShop. To solve my immediate problem though, I'll probably just use text for the links.

Thanks for your help. This is my first time posting to JavaRanch and I appreciate the response.
reply
    Bookmark Topic Watch Topic
  • New Topic