简体   繁体   English

如何将表单“扩展”到Bootstrap面板的两个区域? (浏览器“修复”未关闭的表单标签)

[英]How can I “spread” a form to two areas of a Bootstrap panel? (Browser “fixing” unclosed form tag)

For layout major reasons I want to have two parts of a form in different parts of the page. 由于布局的主要原因,我想在页面的不同部分中包含表单的两个部分。

At the top I have: 在顶部,我有:

<form  name="formXYZ" method="post" action="client-edit-transmission.php">
    <textarea  class="form-control input-sm" name="content" id="textarea" rows="4" cols="50"><?php echo "$content"?></textarea>
    <input name="userName" type="hidden" value="<?php echo "$userName"; ?>">

etc. This is in the top part of a Bootstrap panel. 等等。这在Bootstrap面板的顶部。 It is the message that will be sent out at various times 这是将在不同时间发出的消息

In the panel body I have all the possible times the messages can be sent. 在面板主体中,我有所有可能的时间可以发送消息。 Sun - Sat, week of the month 1-5. 星期日-星期六,每月1-5月。 IE 35 <input type="text fields generated by a php foreach loop pulling down the individual times and ids from a DB. Viz five times: IE 35 <input type="text字段由php foreach循环生成,它从数据库Viz中拉下各个时间和ID,五次:

<tr>
<?php echo ("<td> $localDay  </td>"); // $dayScheduleId
//For each time schedule get time
                foreach ($timeSchedule as $timeItem) { 
echo "<td>";
                    $localTime = $mySchedule->retrieveTime ($timeItem);
                    debug($localTime,"hola");
                    $localTime = $mySchedule->dirtyTime ($localTime);
                  ///////////////////////////////////    NB 5 TIMES A WEEK TIME TAB   ?>
<input name="time_id<?php echo"$timeItem"?>" id="time_id_id<?php echo"$timeItem"?>" class="form-control input-sm" style="width:55px; height:20px; margin:0; padding:2px;  text-align: center;" type="text" value="<?php echo"$localTime"?>">
<?php echo "</td>";
         } 
 echo "</tr>"; 

Originally I had two separate forms but when a user sees the page it is all too tempting to edit the text and then go down the page and edit the times. 最初,我有两种不同的形式,但是当用户看到该页面时,很想编辑文本,然后浏览该页面并编辑时间。 If you hit the top submit button the message is updated and not the times and the bottom button vice versa. 如果单击顶部的“提交”按钮,则消息将更新,而不是时间,底部的按钮反之亦然。 Very unhelpful. 非常无益。

I cleaned everything out and made one big form BUT did not realise that Chrome (and I presume other browsers) inset a </form> tag if you try and push the form past a </div> . 我清理了所有内容,并制作了一个大表单,但如果您尝试将表单推过</div> ,Chrome并没有意识到Chrome(并且我认为其他浏览器)会插入</form>标记。 I presume they are kindly fixing unclosed tags. 我想他们是在修理未封闭的标签。

I have tried naming the forms the same but that does not work. 我试过将表格命名为相同的名称,但这不起作用。 The top part of the form is very simple - just a text area whose value is populated by a php echo . 表单的顶部非常简单-只是一个文本区域,其值由php echo填充。 My JS is rudimentary and jQuery just about non existent. 我的JS是基本的,而jQuery几乎不存在。 If there is not a straight HTML way through this is there a SIMPLE JS solution (and/or PHP)? 如果没有直接的HTML方式,是否有SIMPLE JS解决方案(和/或PHP)?

Grateful for any ideas. 感谢任何想法。

通过简单地传递隐藏字段即可解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM