单击此表单提交无效!怎么了?

时间:2014-02-01 14:20:23

标签: html radio-button

当我将单选按钮从关闭更改为打开以及从打开更改为关闭时,我想要提交表单。我已经尝试过并且现在搜索了大约一个小时,但我认为我的代码出了问题。

<form action="intervista-csv.php" method="post" name="fshi_shkruaj">                       
           <table>
             <tr>
               <th style="color:#900;">Titull</th>
               <th style="color:#900;">Kronika</th>
               <th style="color:#900;">Live</th>
             </tr>
             <?php $i=0; foreach ($results as $result) : ?>
             <tr>
               <td style="width:1200px;">
               <input type="hidden" name="id<?php echo $i; ?>" value="<?php echo $result['id'] ?>" />
               <input type="hidden" name="title<?php echo $i;?>"value="<?php echo htmlspecialchars($result['title'],ENT_NOQUOTES,'UTF-8');?>" />
               <label style="font-size:16px;"><?php echo htmlspecialchars($result['title'],ENT_NOQUOTES,'UTF-8');?></label>
               </td>
               <td style="width:300px;">
               <input type="hidden" name="id<?php echo $i; ?>" value="<?php echo $result['id'] ?>" />
               <input type="hidden" name="kronika<?php echo $i;?>"value="<?php echo htmlspecialchars($result['kronika'],ENT_NOQUOTES,'UTF-8');?>" />
               <label style="font-size:16px;"><?php echo htmlspecialchars($result['kronika'],ENT_NOQUOTES,'UTF-8');?></label>
               </td>
               <td style="width:300px">
                <label><input type="radio" onclick="this.form.submit();" name="shfaq<?php echo $i; ?>" value="1" id="radiobuttonsondazh_0" <?php if($result['live']==1) echo 'checked'; ?>/>Po</label>
                <label><input type="radio" onclick="this.form.submit();" name="shfaq<?php echo $i; ?>" value="0" id="radiobuttonsondazh_1" <?php if($result['live']==0) echo 'checked'; ?>/>Jo</label>            
               </td>
               <td style="width:250px">
                  <input type="checkbox" name="chk<?php echo $i; ?>" >Fshi
               </td>
              </tr>
              <?php $i = $i+1;
                    endforeach;
               ?>
             </table>
             <tr>
               <td>&nbsp;</td>
               <td>&nbsp;</td>
               <td>&nbsp;</td>
               <td><input style="margin-top:26px; margin-left:206px;" type="submit" name="submit" value="Shko Live"  /></td>
             </tr>
            <input type="hidden" value="<?php echo $i = $i-1; ?>" name="saka" />              
        </form>

1 个答案:

答案 0 :(得分:0)

尝试替换

onclick="this.form.submit();"

onClick="document.forms.fshi_shkruaj.submit();"