Summary of select option exceptions, selectoption Summary

Source: Internet
Author: User

Summary of select option exceptions, selectoption Summary

Source: http://www.ido321.com/1189.html

Yesterday, I encountered the option display exception cause in the project, as shown below:

Effect after using css in Firefox


Css in chrome and IE does not work.

Code:

<div class="controls">         <select name="ksname" id="ksname">             <?php                 while (!!$rowDK = fetchAssoc($resultDK))                  {             ?>             <optgroup label="<?php echo $rowDK['name']; ?>">               <?php                $resultKS = queryDB("select table_dake.id,table_keshi.sid,table_keshi.name from table_dake,table_keshi                           where table_dake.name='{$rowDK['name']}' and table_keshi.sid=table_dake.id");                 while(!!$rowKS = fetchAssoc($resultKS))                 {               ?>                 <option  value ="<?php echo $rowKS['name']; ?>"><?php echo $rowKS['name']; ?></option>                                  <?php                     </optgroup>                   }                 }                 free($resultDK);                 free($resultKS);             ?>         </select>     </div>

 

I tried it for a long time. I also found a method on the Internet, but it was fruitless. I just had to ask Daniel. Daniel suggested that I check the source code. Is the style changed? The select part of this Code does not have any style. How can there be more? After reading the source code, there are not many styles, but each option is followed by one more </optgroup>. after looking back at the code, I realized that I wrote </optgroup> in an internal loop. According to my logic, I should have put it in an external loop. After adjustment, everything is normal.

So, another trick is to debug the code: view the original code.


Next article: 90 it communities are waiting for you to pick up !!

Summary of select option exceptions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.