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