Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

element not changing within an ajax response

Posted on 2011-02-19
2
Medium Priority
?
367 Views
Last Modified: 2012-05-11
I have a web page that calls an $.ajax which returns a <div> with a <select> . Then when I select an option The onchange in jQuery is not responding. I know the .live method should help but it isn't helping.

$("#ViewBasedOnSelect").live('change', function(){
		var ViewBasedOn = $(this).val().split("_",3);
		alert(ViewBasedOn[2]);
		$.ajax({
                      type: "POST",
                         url: "ajaxSelectors.php?datagroup="+ViewBasedOn[2]+"&category="+ViewBasedOn[1]+"&ID="+ViewBasedOn[0],
   data: $("form[name=frmViewBasedOn]").serialize(),
   success: function(msg){
		$("#jSelectors").html(msg);   }
		});
		// end of selectors		
		//get the value and determine if 'e' for entity or 'a' for attribute
		// if entity we show the option button
				
		if(ViewBasedOn[1]=='e')
		{
			$("#options").css('visibility', 'visible');
		}
		else
		{
			$("#options").css('visibility', 'hidden');
		}
		
		// check the state of the selector button
		var strButton = $("#selectors").val().split(" ",3);

		if(strButton[0] == "+")
		{
			$("#selectors").val("- "+strButton[1]);
			$("#rowSelectors").show();
		}
		
		this.blur();
	
}
);	

Open in new window

0
Comment
Question by:gbeaulac
  • 2
2 Comments
 

Accepted Solution

by:
gbeaulac earned 0 total points
ID: 34935975
I answered my own question.

I need to add var rpt = ....
0
 

Author Closing Comment

by:gbeaulac
ID: 34935980
Needed to add "var rpt = ..."
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

971 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