Note that there are some explanatory texts on larger screens.

plurals
  1. POCodeIgnitier CSRF protection how submit form which is loaded via jquery tabs
    primarykey
    data
    text
    <p>I'm working on some backend project and want to load form via jQueryUI tabs</p> <pre><code>&lt;div id="parameters_tabs" style="width:920px;"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="&lt;?=base_url()?&gt;link1"&gt;&lt;?=$this-&gt;lang-&gt;line('tab_name')?&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>in response I produce few forms as in example below:</p> <pre><code>&lt;? for ($i = 0; $i &lt; count($groups); $i++) { ?&gt; &lt;form id="group_form&lt;?=$i?&gt;" method="POST" action="&lt;?=base_url()?&gt;update_group"&gt; &lt;input type="hidden" name="&lt;?=$this-&gt;config-&gt;item('csrf_token_name')?&gt;" value="&lt;?=$token?&gt;" /&gt; &lt;input type="hidden" name="id" value="&lt;?=$groups[$i]['id']?&gt;" /&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="text" value="&lt;?=$groups[$i]['name']?&gt;" name="name" /&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" value="&lt;?=$groups[$i]['short_name']?&gt;" name="short_name" /&gt; &lt;/td&gt; &lt;td&gt; &lt;textarea cols="80" rows="4" name="desc"&gt;&lt;?=$mgroups[$i]['desc']?&gt;&lt;/textarea&gt; &lt;/td&gt; &lt;td style="width: 30px"&gt; &lt;a class="save" onclick="$('#group_form&lt;?=$i?&gt;').submit();"&gt;&lt;?=$this-&gt;lang-&gt;line('save')?&gt;&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/form&gt; &lt;? } ?&gt; </code></pre> <p>when clicking on "save" I got standard error about CSRF protection:</p> <p>"An Error Was Encountered</p> <p>The action you have requested is not allowed."</p> <p>Can anyone help me and tell where I made mistake? Of course in source I see proper csrf_token_name.</p>
    singulars
    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.
    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