Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to action controller method through ajax
    primarykey
    data
    text
    <p>I'm currently trying to send data back to a controller for the controller to than pass to a model.</p> <p>When I hit the submit button (with all fields filled in) I get a success response which fires the confirmation dropdown but the brand/save_new_brand() method doesn't fire. I have print_r($_POST); die(); just to be sure but still nothing. </p> <p>The path in the request is correct and is the same barring the method call as the redirect on success so it should be fine there.</p> <p>Here's what I have...</p> <pre><code> $.ajax({ url: "&lt;?=sbase_url()?&gt;admin/brands/save_new_brand", global: true, type: "POST", data: ({ &lt;?php foreach($languages as $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; ?&gt; '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('&lt;?=sbase_url()?&gt;admin/brands/list_all'); }, error: function(xhr,err){ $("#processing").hide(); alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status); alert("responseText: "+xhr.responseText); } </code></pre> <p>The commented bit is something new being added and that's when I found this issue, I've also copied over the "success" segment just for path comparison. All help appreciated, thanks.</p> <p>Edited to add the admin section where this is based is https however on localhost the https is crossed out, could this be interfering with the ajax request?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload