html表单在fieldsets中不起作用

时间:2010-09-05 15:56:52

标签: php html

我有一个字段集,在里面我有一个表单。这是行不通的 。我的意思是说。当我看到使用firebug的标签时,表格标签根本不存在。我们如何克服它。

这是代码如何...它是一个PHP代码..

<div id="dialog-form_surg_couns" title=" Surgical Counselling">

<?php
$surgCount = 0;
foreach($this->surgery as $surgery) {
$surgCount++;
$newId = str_replace(' ','',$surgery->getSurgeryname());
?>
    <div class='fieldreq1Pct'>
      <div class='fieldItemLabel'>
                <label for=''><?php echo $surgery->getSurgeryname() ?></label>
      </div>
        <div class='fieldItemValue'>
                <input type='checkbox' class='surg_couns_tests' id="<?php echo $newId ?>" name='surg_couns_tests' value="<?php echo $surgery->getSurgeryname() ?>" <?php echo (($showValue &&  strstr($visitRecord->getSurgcounstests(),$surgery->getSurgeryname())) ? 'checked' : "" ); ?> onClick="javascript:showBlock(this.id);">
         </div>
    </div>
<?php
if(($surgCount % 3) == 0)
{
?>
                <div class='clear'></div>
<?php
}
}
?>
                <div class='clear'></div>
<hr/>
<?php
foreach($this->surgery as $surgery) {
$newId = str_replace(' ','',$surgery->getSurgeryname());
$fieldCount = 0;
?>
<div id='<?php echo $newId ?>_block' style='display:none;' class='check_block'>
<form method='POST' action ='' id ='<?php echo $newId ?>_form'>
<table border='0' class='surg_table'>
<?php
foreach($this->surgeryTemplate as $surgerytemplate) {
if($surgery->getSurgeryid() == $surgerytemplate->getSurgeryid())
{
$fieldCount++;
$fieldName      = 'field'.$fieldCount;
$fieldId        = $surgerytemplate->getFieldid();
if($surgerytemplate->getRequired() == 'Y')
{
 $required = 'required';
}
else
{
 $required = '';
}
if($surgerytemplate->getType() == 'AN')
{
 $validation = 'alpha';
}
else
{
 $validation = '';
}

?>
<tr>
<td>
<?php echo $surgerytemplate->getFieldname(); ?>
</td>
<td>
<?php
if($surgerytemplate->getType() == 'B')
{
echo '<input type=\'radio\' name=\''.$fieldName.'\' value=\'Yes\'>Yes';
echo '<input type=\'radio\' name=\''.$fieldName.'\' value=\'No\'>No';
}
else
{
echo '<input type=\'text\' name=\''.$fieldName.'\' id=\''.$fieldName.'\' class=\''.$required.'  '.$validation.'\' onblur="checkValid(this.id)"><div id=\''.$fieldName.'error\'></div>';
}
?>
</td>
</tr>
<?php
}
}
?>
</table>
 <center><input type='button' name='submit' value='submit' onclick='javascript:submitSurgeryForm("<?php echo $newId ?>")'></center>
</form>
</div>
<?php
}
?>
</div>

1 个答案:

答案 0 :(得分:1)

您不能在其他表单中包含form标记。以下HTML无效:

 <form>
   <fieldset>
     <form>
       <input>
     </form>
   </fieldset>
 </form>

浏览器会默默地忽略第二个表单,而是将您的页面解释为:

 <form>
   <fieldset>
     <input>
   </fieldset>
 </form>