所以我有这个带有数据的巨大表格,每一行都有它自己的“编辑”按钮,可以打开一个模式窗口。在每个模态窗口中都有一个表单和一个提交按钮。它像这样工作得很好。
现在是棘手的部分。
我使用 bootstrap-modal 添加了第二层,在第一层之上添加了第二个模态。在这个模态中,更多的输入和选择,相同表单的成员。数据得到很好的填充。如果我修改了一些值,关闭第二个模态,然后再次打开它,修改后的值将被保留。
问题是,如果我提交表单(按钮位于第一个模态窗口上),则不会发布第二个模态窗口中的输入......
我错过了什么?这不能做吗?我是否应该尝试使用某种形式的匹配,所以当第二个模式关闭第一个模式中的一些隐藏输入时,它们会被填充并被发布?
以下是代码(部分)的样子:
<form action="submit_modal_projects.php" method="post" class="form-horizontal">
<fieldset> <!-- right column -->
<fieldset class="bordered_fieldset" style="margin-left:10px;">
<legend>Etape</legend>
<div class="control-group">
<div class="controls controls-row">
<label for="" class="span3">Lance</label>
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_obj']; ?>" name="site_compo_site_pf_obj">
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_est']; ?>" name="site_compo_site_pf_est">
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_reel']; ?>" name="site_compo_site_pf_reel">
<input type="checkbox">
<button class="demo btn btn-primary btn-mini" data-toggle="modal" href="#ajax-modal-<?php echo $row['id']; ?>">Detalii</button>
<!-- mini modal -->
<div id="ajax-modal-<?php echo $row['id']; ?>" class="modal hide fade" tabindex="-1" style="display: none; margin-top: -128.5px;" data-width="360">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Detal<?php echo $row_j['site_compo_site_pf_obj_initial']; ?></h3>
</div>
<div class="modal-body">
<h5>Site compo</h5>
<fieldset class="bordered_fieldset">
<legend>Fase</legend>
<div class="control-group">
<div class="controls controls-row">
<label class="span1 text-center"></label>
<label class="span1 text-center">Obj</label>
<label class="span1 text-center">Est</label>
<label class="span1 text-center">Reel</label>
</div>
<div class="controls controls-row">
<label class="span1">Inițial:</label>
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_obj_initial']; ?>" name="site_compo_site_pf_obj_initial" disabled>
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_est_initial']; ?>" name="site_compo_site_pf_est_initial" disabled>
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_reel_initial']; ?>" name="site_compo_site_pf_reel_initial" disabled>
</div>
<div class="controls controls-row">
<label class="span1">Propus:</label>
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_obj']; ?>" id="site_compo_site_pf_obj_propus">
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_est']; ?>" id="site_compo_site_pf_est_propus">
<input type="text" class="span1" value="<?php echo $row_j['site_compo_site_pf_reel']; ?>" id="site_compo_site_pf_reel_propus">
</div>
<div class="controls controls-row">
<label for="" class="span1">Motiv:</label>
<select class="span3" name="site_compo_site_pf_motiv" id="site_compo_site_pf_motiv">
<option value="<?php echo $row_j['site_compo_site_pf_motiv']; ?>"><?php echo $row_j['site_compo_site_pf_motiv']; ?></option>
<option value="opt"></option>
<option value="Modif">Modif</option>
<option value="Retard">Retard </option>
<option value="Lead Time">Lead Time</option>
<option value="Tech">Tech</option>
<option value="Nope">PNope</option>
<option value="Capac">Capac</option>
<option value="Prot">Prot</option>
<option value="Acc2">Acc2</option>
<option value="Acc">Acc</option>
<option value="Supp">Supp</option>
<option value="Other">Other</option>
</select>
</div>
<div class="controls controls-row">
<label for="" class="span1">Detalii:</label>
<input type="text" class="span3" name="lancement_projet_site_compo_site_pf_detalii" id="lancement_projet_site_compo_site_pf_detalii" value="<?php echo $row_j['lancement_projet_site_compo_site_pf_detalii']; ?>">
</div>
</div>
</fieldset>
</div>
<div class="modal-footer">
<button class="btn update">Update</button>
<button type="button" data-dismiss="modal" class="btn">Close</button>
<button type="button" class="btn btn-primary">Ok</button>
</div>
</div>
</div>
</div>
</fieldset>
</fieldset><!-- end right column -->
</form>