PHP Combo box

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
abag2k
Forum Newbie
Posts: 1
Joined: Thu Aug 30, 2007 5:11 am

PHP Combo box

Post by abag2k »

Hello,

I just beginner here using PHP, now i just want to create combobox containing



ALL
Department
Lastname

TextField : [ txtfield ]

if the user selected the ALL - all records will be listed, if DEPARTMENT-the user will type the department name in the TXTFIELD. same idea with lastname.

Thanks,

Mike :cry:
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

To display a combo box use <select>

e.g.

Code: Select all

echo"<select name=\"list\">
   <option value=\"All\">All</option>   //VALUE IS THE ACTUAL DATA/VALUE THAT IS POSTED
   <option value=\"Dept\">Dept</option>
   <option value=\"ln\">Last name</option>
</select>";
As for the textbox that takes the form of:

Code: Select all

echo"<input type=\"text\" name=\"textbox\">";
These two snippets of code obviously need to go inside a form.

For future reference on form elements and conditional statements try looking it up in a search engine. There are some helpful tutorials out there.
Post Reply