element not changing within an ajax response

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);
                      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
			$("#options").css('visibility', 'visible');
			$("#options").css('visibility', 'hidden');
		// check the state of the selector button
		var strButton = $("#selectors").val().split(" ",3);

		if(strButton[0] == "+")
			$("#selectors").val("- "+strButton[1]);

Open in new window

Who is Participating?

Improve company productivity with a Business Account.Sign Up

gbeaulacConnect With a Mentor Author Commented:
I answered my own question.

I need to add var rpt = ....
gbeaulacAuthor Commented:
Needed to add "var rpt = ..."
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.