Bug Tracker

Modify

Ticket #1976 (closed bug: duplicate)

Opened 5 years ago

Last modified 5 years ago

.change() doesn't work for <SELECT>

Reported by: BartekR Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: SELECT .change() Cc:
Blocking: Blocked by:

Description

HTML:

<select name="status" id="status"> <option value="0">Option 0</option> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> </select>

JS: $('#status').change(function() {

alert('status: ' + $('#status :selected').val());

});

When I change option i <select> nothing happens. Tested on FF 2.0.0.9, IE 6.0 Win XP Prof/WinXP Home

Change History

comment:1 Changed 5 years ago by davidserduke

Does the wiki example here not work for you?

 http://docs.jquery.com/Events/change#fn

It works for me in FF 2.0.0.9 as well as IE6/7.

comment:2 Changed 5 years ago by BartekR

I'm sorry, I wasn't percise. I've made more tests, searched the tickets and I think it's error related to  http://dev.jquery.com/ticket/1598 and  http://dev.jquery.com/ticket/1698. I'm loading the script with $('#details).load(script.php) and the $('#status').change(function() {...) is inside script.php.

I think the ticket can be closed with status duplicate or sth.

comment:3 Changed 5 years ago by davidserduke

  • Status changed from new to closed
  • Resolution set to duplicate

The reporter says it is a duplicate so it will be closed as such.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.