Render a specific part of html after success Ajax

plumberleaker

New Member
Myproblem is when I click my first selectbox, after there is a value, it will trigger the second selectbox. I implement it in Ajax, but successfully render ,but my other textfield value is gone. How could I just render a specific part of the responde html(success ajax call)?\[code\]$(document).ready(function(){ if ($('#product_category').val() == 'Choose Category') document.getElementById('product_subcategory').disabled = true; $('#product_category').change(function () { if ($('#product_category').val() == 'Choose Category') document.getElementById('product_subcategory').disabled = true; else document.getElementById('product_subcategory').disabled = false; data = http://stackoverflow.com/questions/12740667/$('#product_category').val(); //alert(data); var param = 'category_name=' + data; $.ajax({ url: MYURL, data: param, success: function(result) { alert('Choose product subcategory'); alert(param); $('body').html(''); $('body').html(result); } }); // window.location = MYURL?category_name="+data; }); $('#product_subcategory').change(function () { data = http://stackoverflow.com/questions/12740667/$('#product_subcategory').val(); // paramCategory = $(document).getUrlParam('category_name'); // alert(paramCategory); $.get(MYURL, function(data){ alert("Data Loaded: " + data); }); //window.location = MYURL?subcategory_name=" + data; });});\[/code\]in my form, i use $_GET['category_name'] to get my value Ajax return value. I Debug in firebug, and it is successfully. I tried to render again the html, but my previous textarea's value and textfiel's value is gone since what i did is $('body').html(''); $('body').html(result);, So,how could I manage to get the success ajax return value, and use it in the PHP.any confusion ,please tell me...Thank you for spending ur time.
 
Back
Top