Solved

Jquery and internal elements

Posted on 2011-02-16
4
537 Views
Last Modified: 2012-06-21
I created 4 <select> elements using a jQuery in my html page. Once they are generated I want to attach a .change event to each select to call yet another ajax function. it does not work. Why?

I presume it is because the elements (select) don't exist in the html?

0
Comment
Question by:gbeaulac
  • 3
4 Comments
 
LVL 51

Accepted Solution

by:
HainKurt earned 500 total points
ID: 34909955
any sample code?

check this link

http://api.jquery.com/live/

.live()

Description: Attach a handler to the event for all elements which match the current selector, now and in the future.

0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34909992
try something like this:

$('#myID').live('change',function() {
  alert('change event for dynamic component');
});

after creating a new element with id=myID
0
 

Author Comment

by:gbeaulac
ID: 34910076
@HainKurt

Thank you so much! That worked! I'm so grateful. Thank you. thank you. Thank you.

GB
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34910372
welcome :) glad it worked... jQuery intrduced this fueature recently i guess (oops they added with 1.3)...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.NET AJAX callbacks to web service are becoming very popular and unavoidable these days. The feel that the user gets when only a part of the page is updated without even hindering the UI is the advantage that the callbacks offer. The wait for the…
Today I am discussing AJAX problems in IE7 and I bet this will helps many guys out here who have problems with AJAX work. Lets start with the discovery of problem and then we will talk about its different solutions. My last two projects included …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question