i want to use html select controle with multiple property

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lokesh_kumar_s
Forum Commoner
Posts: 48
Joined: Mon Apr 13, 2009 5:39 am
Contact:

i want to use html select controle with multiple property

Post by lokesh_kumar_s »

hi i want to use html select controle with multiple property

Code: Select all

 
<select multiple="multiple" name="DrpEmployee" style="width: 173px">
<option>select1</option>
<option>select2</option>
<option>select3</option>
</select>
 
so to get multiple celected values in drop down list what can i do in PHP

Thanks,
lokesh
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: i want to use html select controle with multiple property

Post by mattpointblank »

<option selected="selected">Value</option>
lokesh_kumar_s
Forum Commoner
Posts: 48
Joined: Mon Apr 13, 2009 5:39 am
Contact:

Re: i want to use html select controle with multiple property

Post by lokesh_kumar_s »

mattpointblank wrote:<option selected="selected">Value</option>
No i telling how can i access it
like $emp=$_POST['emp'];
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: i want to use html select controle with multiple property

Post by papa »

Access it as any POST or GET var when form is submitted.
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: i want to use html select controle with multiple property

Post by mattpointblank »

Change the <select> field's name to 'DrpEmployee[]' (add the brackets to make it an array), then you can access an array of the selected options with $_POST['DrpEmployee'].
Post Reply