Note that there are some explanatory texts on larger screens.

plurals
  1. POForm elements values don't get posted if inside modal
    text
    copied!<p>So I have this huge table with data, each row has it's own "edit" button that opens a modal window. In each of these modal windows there is a form, and a submit button. It works just fine like this. </p> <p>Now comes the tricky part.</p> <p>I added a second layer using bootstrap-modal, a second modal on top of the first one. Inside this modal, more inputs and selects, members of the same form. The data gets populated nicely. If I modify some values, close this 2nd modal, and open it again, the modified values are kept.</p> <p>The problem is that if I submit the form (the button is on the 1st modal window) the inputs in the 2nd modal don't get posted...</p> <p>What am I missing? Can't this be done? Should I try using some form of matching, so when the 2nd modal closes some hidden inputs in the 1st modal get populated and they get posted instead?</p> <p>Here's how (part of) the code looks like:</p> <pre><code> &lt;form action="submit_modal_projects.php" method="post" class="form-horizontal"&gt; &lt;fieldset&gt; &lt;!-- right column --&gt; &lt;fieldset class="bordered_fieldset" style="margin-left:10px;"&gt; &lt;legend&gt;Etape proiet&lt;/legend&gt; &lt;div class="control-group"&gt; &lt;div class="controls controls-row"&gt; &lt;label for="" class="span3"&gt;Lancement projet Site compo - Site PF&lt;/label&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_obj']; ?&gt;" name="lancement_projet_site_compo_site_pf_obj"&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_est']; ?&gt;" name="lancement_projet_site_compo_site_pf_est"&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_reel']; ?&gt;" name="lancement_projet_site_compo_site_pf_reel"&gt; &amp;nbsp; &lt;input type="checkbox"&gt; &lt;button class="demo btn btn-primary btn-mini" data-toggle="modal" href="#ajax-modal-&lt;?php echo $row['id']; ?&gt;"&gt;Detalii&lt;/button&gt; &lt;!-- mini modal --&gt; &lt;div id="ajax-modal-&lt;?php echo $row['id']; ?&gt;" class="modal hide fade" tabindex="-1" style="display: none; margin-top: -128.5px;" data-width="360"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h3&gt;Detalii suplimentare&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_obj_initial']; ?&gt;&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;h5&gt;Lancement projet Site compo - Site PF&lt;/h5&gt; &lt;fieldset class="bordered_fieldset"&gt; &lt;legend&gt;Fază replanificată&lt;/legend&gt; &lt;div class="control-group"&gt; &lt;div class="controls controls-row"&gt; &lt;label class="span1 text-center"&gt;&lt;/label&gt; &lt;label class="span1 text-center"&gt;Obj&lt;/label&gt; &lt;label class="span1 text-center"&gt;Est&lt;/label&gt; &lt;label class="span1 text-center"&gt;Reel&lt;/label&gt; &lt;/div&gt; &lt;div class="controls controls-row"&gt; &lt;label class="span1"&gt;Inițial:&lt;/label&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_obj_initial']; ?&gt;" name="lancement_projet_site_compo_site_pf_obj_initial" disabled&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_est_initial']; ?&gt;" name="lancement_projet_site_compo_site_pf_est_initial" disabled&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_reel_initial']; ?&gt;" name="lancement_projet_site_compo_site_pf_reel_initial" disabled&gt; &lt;/div&gt; &lt;div class="controls controls-row"&gt; &lt;label class="span1"&gt;Propus:&lt;/label&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_obj']; ?&gt;" id="lancement_projet_site_compo_site_pf_obj_propus"&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_est']; ?&gt;" id="lancement_projet_site_compo_site_pf_est_propus"&gt; &lt;input type="text" class="span1" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_reel']; ?&gt;" id="lancement_projet_site_compo_site_pf_reel_propus"&gt; &lt;/div&gt; &lt;div class="controls controls-row"&gt; &lt;label for="" class="span1"&gt;Motiv:&lt;/label&gt; &lt;select class="span3" name="lancement_projet_site_compo_site_pf_motiv" id="lancement_projet_site_compo_site_pf_motiv"&gt; &lt;option value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_motiv']; ?&gt;"&gt;&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_motiv']; ?&gt;&lt;/option&gt; &lt;option value="alte optiuni"&gt;&lt;/option&gt; &lt;option value="Modification du planning par le client"&gt;Modification du planning par le client&lt;/option&gt; &lt;option value="Retard livraisons Matieres et Accessoires"&gt;Retard livraisons Matieres et Accessoires&lt;/option&gt; &lt;option value="Lead Time DQF Somarest"&gt;Lead Time DQF Somarest&lt;/option&gt; &lt;option value="Manque donnees techniques"&gt;Manque donnees techniques&lt;/option&gt; &lt;option value="Pas d'information du client"&gt;Pas d'information du client&lt;/option&gt; &lt;option value="Probleme de capacite SO"&gt;Probleme de capacite SO&lt;/option&gt; &lt;option value="KO (M,Proto,TDS)"&gt;KO (M,Proto,TDS)&lt;/option&gt; &lt;option value="KO Accessoires SO"&gt;KO Accessoires SO&lt;/option&gt; &lt;option value="KO Accessoires Client"&gt;KO Accessoires Client&lt;/option&gt; &lt;option value="KO Fournisseur"&gt;KO Fournisseur&lt;/option&gt; &lt;option value="Autres"&gt;Autres&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div class="controls controls-row"&gt; &lt;label for="" class="span1"&gt;Detalii:&lt;/label&gt; &lt;input type="text" class="span3" name="lancement_projet_site_compo_site_pf_detalii" id="lancement_projet_site_compo_site_pf_detalii" value="&lt;?php echo $row_j['lancement_projet_site_compo_site_pf_detalii']; ?&gt;"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn update"&gt;Update&lt;/button&gt; &lt;button type="button" data-dismiss="modal" class="btn"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Ok&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;/fieldset&gt;&lt;!-- end right column --&gt; &lt;/form&gt; </code></pre>
 

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