三种形式,两种提交,一种不提供

时间:2016-06-02 16:43:00

标签: jquery html zurb-foundation laravel-5.2

我一直想知道导致表单无法提交的内容,我创建的单个页面有3个按钮用于打开单独的模式框,这3个表单,3个单独的modals(Foundation 5),其中两个在提交时工作,但在打开另一个模态表单并填写后,单击“提交”按钮不会执行任何操作。

表格:

    {!! Form::open(array('url' => 'reports/' . $report->rid . '/edit/frequency', 'id' => 'frequency', 'method' => 'POST')) !!}

                                        <label>RID:</label> <input class="form-control" type="text" name="newrid" value="{!!$report->rid!!}" readonly>

                                        <label>Day:</label> <select class="form-control" id="days" name="newday[]" multiple>
                                                                        <option value="monday">Monday</option>
                                                                        <option value="tuesday">Tuesday</option>
                                                                        <option value="wednesday">Wednesday</option>
                                                                        <option value="thursday">Thursday</option>
                                                                        <option value="friday">Friday</option>
                                                                        <option value="saturday">Saturday</option>
                                                                        <option value="sunday">Sunday</option>
                                                                        </select>

                                        <label>Scheduled Time:</label> <select id="newsched" class="form-control" name="newsched">
                                        <?php
                                            $s_start = "00:00:00";
                                            $s_end = "23:45:00";
                                            $stStart = strtotime($s_start);
                                            $stEnd = strtotime($s_end);
                                            $stNow = $stStart;
                                            while($stNow <= $stEnd){
                                              $stime= date("H:i:s",$stNow);
                                              echo "<option value = '".$stime."'>".$stime."</option>";
                                              $stNow = strtotime('+15 minutes',$stNow);
                                            }
                                            ?>
                                        </select>

                                        <label>Expected Complete Time:</label> <select id="newect" class="form-control" name="newect">
                                        <?php
                                            $e_start = "00:00:00";
                                            $e_end = "23:45:00";
                                            $eStart = strtotime($e_start);
                                            $eEnd = strtotime($e_end);
                                            $eNow = $eStart;
                                            while($eNow <= $eEnd){
                                              $estime= date("H:i:s",$eNow);
                                              echo "<option value = '".$estime."'>".$estime."</option>";
                                              $eNow = strtotime('+15 minutes',$eNow);
                                            }
                                            ?>
                                        </select>
                                        <label>SLA Time:</label> <select id="newsla" class="form-control" name="newsla">
                                            <?php
                                                $start = "00:00:00";
                                                $end = "23:45:00";
                                                $tStart = strtotime($start);
                                                $tEnd = strtotime($end);
                                                $tNow = $tStart;
                                                while($tNow <= $tEnd){
                                                  $time= date("H:i:s",$tNow);
                                                  echo "<option value = '".$time."'>".$time."</option>";
                                                  $tNow = strtotime('+15 minutes',$tNow);
                                                }
                                            ?>
                                        </select>

                                        <label>Hours until report Expires (can be left blank to expire at end of calendar day):</label> <input class="form-control" type="text" name="newexp" id="expire_time" value="" placeholder="HH:MM:SS" />

                                        <label>Time Zone:</label> <select id="newtz" class="form-control" type="te

xt" name="newtz">
                                    <option value=""></option>
                                    <option value='America/Los_Angeles'>America/Los_Angeles </option>
                                    <option value='Europe/London'>Europe/London </option>
                                    <option value='US/Mountain'>US/Mountain </option>
                                    <option value='US/Eastern'>US/Eastern </option>
                                    <option value='GMT'>GMT </option>
                                    <option value='Europe/Bucharest'>Europe/Bucharest </option>
                                    <option value='Europe/Istanbul'>Europe/Istanbul </option>
                                    <option value="US/Alaska">US/Alaska</option>
                                    <option value="US/Central">US/Central</option>
                                    <option value="US/Eastern">US/Eastern</option>
                                    <option value="US/Mountain">US/Mountain</option>
                                    <option value="US/Pacific">US/Pacific</option>
                                    <option value="US/Hawaii">US/Hawaii</option>
                                    <option value="Africa/Johannesburg">Africa/Johannesburg</option>
                                    <option value="Asia/Manila">Asia/Manila</option>
                                    <option value="Asia/Tokyo">Asia/Tokyo</option>
                                    <option value="Asia/Hong_Kong">Asia/Hong_Kong</option>
                                    <option value="Asia/Kuala_Lumpur">Asia/Kuala_Lumpur</option>
                                    <option value="Europe/Amsterdam">Europe/Amsterdam</option>
                                    <option value="Europe/London">Europe/London</option>
                                    <option value="Europe/Istanbul">Europe/Istanbul</option>
                                    </select>   
    {!! Form::submit('Add Frequency', array('class' => 'button default radius','form' => 'frequency')) !!}
    {!! Form::close() !!}

我在Laravel中使用了Foundation 5,所以我不确定在单个刀片中是否有关于form :: open的限制。表格在单独的刀片视图中进行测试,并提交(连同所有js),因此不确定它们是否属于三个独立的模态框或三个帖子形式。允许在一个刀片中。

1 个答案:

答案 0 :(得分:0)

得到了我自己的答案。 id ='frequency'的表格会导致与表单混淆,表单恰好具有相同的ID。