Home > Backend Development > PHP Tutorial > 关于select下拉列表的selected属性

关于select下拉列表的selected属性

WBOY
Release: 2016-06-23 14:08:56
Original
1832 people have browsed it

echo "

";

在echo 出来的select下拉菜单 的option  里面要加selected属性 根据$pColor[$j]是否等于$colorTemp[0]进行判断,如果是selected属性为true 否则为false  该怎么写啊,大神来救我。。


回复讨论(解决方案)

echo "";

我的 option 是循环出来的然后根据 $pColor[$j]==$colorTemp[0] ? 判断 不是要直接在一行option 标记

echo "";
果然是大神,问题解决。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template