2013-03-04 74 views
0

这个网站码PHP textarea的验证形式刷新不工作

<div class="textarea_box"> <strong><span>*</span> Tooltip Message to be displayed:</strong> 
      <?php $class = 'correct';if (isset($flag) && ($flag == 4)){$class = 'wrong';}$content = isset($disp_msg) ? $disp_msg : "";?> 
      <textarea name="txtDispMsg" cols="1" rows="1" class="<?php echo $class; ?>"><?php echo $content;?></textarea> 
</div> 

这是CSS代码

#Form1 textarea .wrong { 
border:2px solid #F00; 
} 

一切都很好,除了在错误时不会使textarea的边框红色的情况下(即#F00) 什么可能是错的?球员?

回答

4

删除您选择的空间,#Form1 textarea .wrong#Form1 textarea.wrong

2

你的CSS是说找与文本区域内的类“错误”的元素,当而是应该寻找一个textarea一类的'wrong'

#Form1 textarea.wrong { ... }