The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled PHP Code
Posted by: dfgdf | February 15, 2010 @ 7:48am
PHP Code
[
Download
]
<?$i=0; foreach ($categories as $_category){ if($_category->hasChildren()){ $i++;?> <select id="id<?=$_category->getId();?>" class="pa left1 top6" onchange="document.getElementById('HiddenField').value=this.options[this.selectedIndex].value;" style="visibility: <?if($i==1) echo 'visible'; else echo 'hidden';?>"> <?foreach($_category->getChildren() as $subcategory){ if($subcategory->getIsActive()){?> <option title="<?=$subcategory->getName();?>" value="<?=$subcategory->getId();?>" > <?=mb_substr($subcategory->getName(),0,30); if(mb_strlen($subcategory->getName()) > 30) echo '...';?> </option> <?}}?> </select> <?}}?> <input type="hidden" id="HiddenField" name="category" value="" />
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.54 / 8
61 Votes
http://codebin.yi.org/504
page generated in 0.01 seconds