LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-18-2010, 09:21 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Rep: Reputation: 51
Two elements inside a form in HTML - how? (interfacing with PHP)


Hi,
For a search box on my site, I want a textbox, which will let the user input the term to be searched for, and next to it I want a drop down list that'll have, for example, "Fruit" and "Vegetables" as categories to be searched within. How do I do the HTML for this? (so that the arguments to my search.php script will be eg. "search.php?text=apples&type=fruit" ? )

Thanks.
 
Old 09-18-2010, 09:30 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Normally you would use the POST method and so the arguments wouldn't appear ion the URL. However you can look at using the GET method, but I'm not sure that this gains you much.
 
Old 09-18-2010, 09:39 AM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Original Poster
Rep: Reputation: 51
No, what's the HTML for two elements (textarea and drop down list) for one form?
 
Old 09-18-2010, 10:24 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
It's no different from one, just make sure that you have unique names for each. Maybe you should show the tags that you have currently used in your form.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using PHP inside of HTML on a Slackware server, Bobcat3Romeo1 Linux - Software 15 06-18-2010 05:53 AM
HTML form data in PHP without postback? linuxlover.chaitanya Programming 18 02-11-2010 11:10 PM
html form - order of returned elements rblampain Programming 2 04-26-2007 07:13 AM
PHP and HTML Form Post Savahn Programming 12 06-30-2004 03:15 PM
PHP: referencing form elements with dynamic names Locura Programming 5 03-18-2004 10:24 AM


All times are GMT -5. The time now is 11:46 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration