gbeaulac
asked on
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);
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();
}
);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER