• 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

Netscape href issue

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone know why this won't work in Netscape, but it works in IE..
<a href="#"><html:submit styleClass="formButton" value="Login"/></a>

This is displayed in the page source.
<a href="#"><input type="submit" value="Login" class="formButton"></a>
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why are you doing that in the first place?
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This site is designed using the struts framework. I don't have much experience with struts, but it seems that this is a requirement for tiles.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Struts taglib is working correctly. That's what the resulting HTML should look like. I'd suggest removing the <a> tags completely -- you won't need them.
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The <a> need to be in there for a mouse over effect..
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Matt Hoffman:
The <a> need to be in there for a mouse over effect..



What mouseover effect are you trying to achieve? I don't see any events attached to the code you posted above...
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's something fundamentally wrong with the idea of a submit button being embedded in a hyperlink. Both constructs are expected to transfer the browser somewhere else, and the do so under mutually incompatible rules.

If this is really a documented feature of IE, Microsoft's been playing fast and loose with specs again and you can expect not only Netscape/Mozilla, but Opera and every other non-MS web browser out there to fail the test as well.

If you really want a "submit button" that changes when you roll the mouse over it - and be friendly to the non-IE world, the traditional method is to use JavaScript and swap button images as the mouse rolls over/off the "button" and sensitize the image area to invoke a submitting function.
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue that I am having is that we are NOT allowed to use javascript because of security reasons. The Java developers found a way to use the hover buttons using css without javascripting. I need to find a way to enable this in netscape without using any type of javascirpt language.

Any ideas?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are out of luck...

IE does some wird things and that is one of them....

Eric
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well the issue is not with IE, though..

In Netscape, I cannot click on the button. In IE this works. If I click on it in Netscape, nothing happens.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue is with IE since it renders it, it does funky things that the other browsers do not do.

By you saying hat JavaScript is a "security issue" I am assuming hat all browsers have it disabled?

Eric
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh ok.. I see your point.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The issue that I am having is that we are NOT allowed to use javascript because of security reasons.



This is a completely unrealistic requirement if you want any sort of client-side activity such as rollovers. And as you have seen, resorting to browser tricks will just make your code obfuscated, weird and prone to funky behavior.

Either use Javascript wisely, or eschew client-side activity.
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Technically the CSS2 pseudo-classes (e.g. :hover) can be applied to any HTML tag. I'm not convinced that you'll get much joy out of browser support for this however, but it might be worth trying:

with the associated CSS being something like:

I won't hold my breath while you test this. :roll:

As an aside, what's the point of that Struts html:submit tag? All it seems to do is obfuscate the HTML...

Jules
 
Matt Hoffman
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The CSS looks like:

A.formButton:hover
{background-color: #000099;
color: #FFFFFF;}
 
JulianInactive KennedyInactive
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I was curious so I took 5 minutes to try it out. Here's the rough test code:

Here's the results (surprising):

IE6 - has it's own rollover style for form buttons anyway which, IMHO, doesn't need adding to.
Link example works; DIV example exhibits default behaviour.
NN6.1 - I haven't got 7 on my PC
Link example underlines button text and hovering changes underline to white; DIV example shows background colour, but only when not hovering over button (i.e. hovering in DIV area next to it) D'oh!; default button exhibits no rollover behaviour
Opera 7.1 - Link example exhibits default behaviour (which is to highlight the submit button rather nicely IMHO); DIV example shows background colour when hovering in DIV area and even when hovering over the submit button.;
IE5.5 - Does absolutely naff all. Furrows its brow as if to say, "what's hover?" Not a flicker.

Conclusion: Either don't bother because the browsers don't do what you want to do consistently or create your own button image, whack a link around it and use javascript:myForm.submit(). You can then use CSS hover styling to your heart's content. I suppose you could always serve Netscape slightly different code (yuk).

That's my considered opinion. Hope it helps.

Jules
[ August 18, 2004: Message edited by: Julian Kennedy ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic