开发者

Working with "multiple" select

In my profile advanced search i have an mutiple se开发者_运维技巧lect type..

<form method="POST">
                     <select size="6" name="Cities" multiple="multiple" id="Cities">
    <option value="0">All</option>
    <option value="1">City1</option>
    <option value="2">city2</option>
    <option value="3">city3</option>
    <option value="4">city4</option>
    <option value="5">city5</option>
</select>
</form>

How do I use it, I mean how should i call what they have chosed...As you can choose one or more options (by holding in control, or just holding in mouseclick and point to other options).


Give it the name Cities[] instead of Cities, and you'll have an array in $_POST['Cities'] on submit.


google helps http://www.onlinetools.org/tricks/using_multiple_select.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜