Subject:
|
Re: Search button
|
Newsgroups:
|
lugnet.admin.general
|
Date:
|
Fri, 17 Mar 2000 23:55:43 GMT
|
Viewed:
|
796 times
|
| |
| |
"David Eaton" <deaton@intdata.com> wrote in message
news:FrL7Ln.7vs@lugnet.com...
>
> Actually, I was recently playing with this (using MSIE 5.0, NN 4.05) and I
> think the results were the same in MSIE and NN:
>
> onkeypress:
> - This performs the function when ANY character is entered, but STOPS the
> submit if further characters are entered (in other words, type quickly!).
> And finally, for extra frustration, it doesn't submit the last character
> entered (which is fine if the last character is a \n, but not so
> otherwise.)
> onkeydown:
> - Same gosh darn thing as onkeypress! (Stupid? yes!)
Yeah, they are basically the same. MSDN claims they are different, but they
appear to function identically in IE5. As for the last character being cut
off, that didn't happen to me in my test:
http://www-personal.umich.edu/~koesel/FormTest.htm
> What you might want is "onchange", but that has issues when more than 1 text
> field is within the form... As I recall, "onchange" resulted in:
>
> onchange w/ 1 text box:
> - MSIE: Form is submitted when enter is hit
> - NN: Form is submitted when enter is hit
> onchange w/ 2 text boxes:
> - MSIE: Form is NOT submitted when enter is hit, but it IS submitted when
> focus is taken off the text box (Stupid? yes.)
> - NN: Form is submitted when enter is hit
I am not sure of your test conditions, but you may have been seeing cross
talk
from the default behavior. Anyway, the onchange event is not really meant
to
handle such things (though it may be made to do so in a pinch).
> Alternatively you could cheat and put ALL the entry fields into ONE form, then
> use javascript to control what fields are input where (although that causes no
> end of coding nightmares... You need to deal with all these javascript tags on
> the entry fields, extra javascript functions, the 'onsubmit' tag, etc. It's a
> lot of useless effort, but it CAN be made to work if you're a masochistic
> coder!)
Yeah, that's probably one of the most round-about ways to do it :)
|
|
Message has 1 Reply: | | Re: Search button
|
| (...) something I didn't do, which is to expressly trap for the enter key-- You used "window.event.keyCode", which apparently is different in NN (I looked briefly in O'Reilly's Dynamic HTML-- apparently it's a bit different for each browser, but (...) (25 years ago, 18-Mar-00, to lugnet.admin.general)
|
Message is in Reply To:
| | Re: Search button
|
| (...) Actually, I was recently playing with this (using MSIE 5.0, NN 4.05) and I think the results were the same in MSIE and NN: onkeypress: - This performs the function when ANY character is entered, but STOPS the submit if further characters are (...) (25 years ago, 17-Mar-00, to lugnet.admin.general)
|
131 Messages in This Thread: (Inline display suppressed due to large size. Click Dots below to view.)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|