douyoupingji7238 2012-07-06 10:28
浏览 13

PHP文件中的Html代码 - 我收到错误

<input type="text"  class="inputtext big" name="headline" 
value="<?php echo $row['headline'];?>" 
<?php if(isset($stop)){echo'disabled="disabled"'; } ?>  />

When i use the above code ....the textbox is not disabled...

I have set an stop variable there...

What could be the problem plus the input box closing tag /> is shown in different color...

  • 写回答

1条回答 默认 最新

  • dongzheng3113 2012-07-06 10:35
    关注

    Without seeing your generated HTML it is hard to say for sure, but it looks like you are ending up with markup that has no space between the value="" attribute and the disabled attribute. It also seems like you have no space between echo and 'disabled'.

    Change your disabled logic to this:

    <?php if(isset($stop)){echo ' disabled="disabled"'; } ?>  />
    
    评论

报告相同问题?