php - Unable to action controller method through ajax -
i'm trying send data controller controller pass model.
when hit submit button (with fields filled in) success response fires confirmation dropdown brand/save_new_brand() method doesn't fire. have print_r($_post); die(); sure still nothing.
the path in request correct , same barring method call redirect on success should fine there.
here's have...
$.ajax({ url: "<?=sbase_url()?>admin/brands/save_new_brand", global: true, type: "post", data: ({ <?php foreach($languages $lang): if($lang['language_status'] == 'show'): echo "'brand_name_" . $lang['language_id'] . "' : $('#brand_name_" . $lang['language_id'] ."').val(),"; echo "'description_" . $lang['language_id'] . "' : tinymce.get('description_". $lang['language_id'] . "').getcontent(),"; endif; endforeach; ?> 'brand_status' : $('#brand_status :selected').val() //,'brand_country' : $('#brand_country :selected').val() }), datatype: "html", async: true, beforesend: function() { $('#submit_button').hide(); $("#processing").show(); }, success: function(data){ parent.$.fancybox.close(); $("#processing").hide(); $.prompt('brand created!',{ show:'slidedown', opacity: 0.5, timeout:2000, overlayspeed:'fast', promptspeed:'fast' }); $('#list_content').load('<?=sbase_url()?>admin/brands/list_all'); }, error: function(xhr,err){ $("#processing").hide(); alert("readystate: "+xhr.readystate+"\nstatus: "+xhr.status); alert("responsetext: "+xhr.responsetext); }
the commented bit new being added , that's when found issue, i've copied on "success" segment path comparison. appreciated, thanks.
edited add admin section based https on localhost https crossed out, interfering ajax request?
try use
url: "<?php echo base_url(); ?>admin/brands/save_new_brand",
Comments
Post a Comment