aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes problem with calling jsp page on evenet onSelect/onClick Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with calling jsp page on evenet onSelect/onClick" Watch "problem with calling jsp page on evenet onSelect/onClick" New topic
Author

problem with calling jsp page on evenet onSelect/onClick

Vijay Kumar
Ranch Hand

Joined: Jul 24, 2003
Posts: 260
hi
I have select(combo box) having differnt values..
I want to call a jsp page as soon as he select an option...
I used onSelect,onClick event bt they are not working..
code is

<select name='orderby' onSelect='this.form.submit()'>
<option value='jobsheet' >Jobsheet</jobsheet>
<option value='date'>Date</jobsheet>
<option value='name'>Name</jobsheet>
<option value='model'>Model</jobsheet>
</select>

plz suggest me...
thankx..
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
onselect is not an event handler of that element.

The event handler you want is onchange.

Eric
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30293
    
150

Chango,
"onSelect" is only valid for inputing in text or textareas.
"onClick" is only valid for buttons, checkboxes and links.

If you are sure the user will only use the mouse to pick an item, you can use "onChange." This will trigger as soon as the user clicks an item.

If you think the user might be using the keyboard, you should use "onBlur." This triggers when the user leaves the field. Here, you will need some javascript to see whether the data changed. You can also write a little JavaScript to merge the two approaches.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with calling jsp page on evenet onSelect/onClick