How to send data-id to action?
<p>I have this function:</p>

<p>Code <strong>PHP:</strong></p>

<pre><code>&lt;?php
foreach($this-&gt;pacientsInfo AS $pacient)    
                { ?&gt;

    &lt;button class="inmail" data-toggle="modal" data-target="#inMail" data-patient-id="&lt;?php echo $pacient['id']; ?&gt;"&gt;&lt;i class="fa fa-inbox"&gt;&lt;/i&gt;&lt;span&gt;In-mail&lt;/span&gt;&lt;/button&gt;

&lt;?php

?&gt;
</code></pre>

<p>This code has the following result:</p>

<pre><code>&lt;button class="inmail" data-toggle="modal" data-target="#inMail" data-patient-id="191"&gt;
</code></pre>

<p>
    In-mail
  
</p>

<p>What I want to do is send ID on this form:</p>

<p>Code <strong>HTML:</strong></p>

<pre><code>&lt;div class="modal-body"&gt;
    &lt;div id="inbox_message"&gt;
        &lt;form method="post" action="&lt;?php  echo $this-&gt;serverUrl().str_replace('public','',$this-&gt;basePath()).'/user/sendmessagetoinbox/'; //here I should to add data-patient-id ?&gt;"&gt;
            &lt;fieldset&gt;
                &lt;label&gt;Subject&lt;/label&gt;
                &lt;input type="text" name="inbox_subject" /&gt;
            &lt;/fieldset&gt;

            &lt;fieldset&gt;
                &lt;label&gt;Message&lt;/label&gt;
                &lt;textarea name="inbox_message"&gt;&lt;/textarea&gt;
            &lt;/fieldset&gt;

            &lt;fieldset&gt;
                &lt;button type="submit" class="btn btn-primary btn-save send-btn"&gt;Send message to inbox&lt;/button&gt;
                &lt;!-- &lt;input type="submit" class="btn btn-submit" value="Send message to inbox" /&gt; --&gt;
            &lt;/fieldset&gt;
        &lt;/form&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>After function <code>sendmessagetoinbox</code> I must transmit <code>data-patient-id</code></p>

<p>It takes a function in jquery to do that? You show me a brief example please?</p>

<p>Thanks in advance!</p>