• 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

problems with onkeypress event and select element

 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy,

This is also probably appropriate to go in the struts forum, but I'll start here.

I am working on a web app and having problems getting the onkeypress and select element to "be friends".

If I take a simple chunk of code:

and plop it in a plain html file with the html/head/body tags around it, I get the "Howdy!" alert when pressing a key when the select element has focus.

The web app I'm working on uses Struts and Websphere/RAD, and this simple chunk of code doesn't fire the alert.
The page is rendering fine and even validates ok with the html transitional dtd.

There is also some other weird-ness with the page such as a span tag won't render a font bold style, but will render a font size.

Anyone encounter a situation like this?

- Doug
-- Nothing is impossible if I'mPossible
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Doug,

I would suggest to install the firebug plugin on your firefox, and use it to inspect the page you get so that you may see if there are any differences between the output you get and the output you expected.


(peace)
 
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
Just because the HTML validates doesn't mean that it's semantically correct. The problems you are having are textbook cases of poor HTML.
 
Doug Slattery
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Just because the HTML validates doesn't mean that it's semantically correct.


I don't disagree being thrown into phase 2 of this project after the last guy bailed. There were a *lot* of obvious problems with this page I fixed before validating it. It's a rather large page, just the html is ~ 3000 lines, so it's taking some time to digest.

I would suggest to install the firebug plugin on your firefox


I tried Firebug, but between vi, RAD and Venkman, imho, Firebug didn't bring anything useful to the table.

Anyway, I found the problem. In the post (and standalone test page) I used alert(...), but in the project, I used Alert(...). *doh* -- bonehead award of the day .

- Doug
-- Nothing is impossible if I'mPossible
reply
    Bookmark Topic Watch Topic
  • New Topic