Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Web Form Help - how can they user choose between a drop down or textbox?
Old 02-17-2008, 08:18 PM Web Form Help - how can they user choose between a drop down or textbox?
Experienced Talker

Posts: 36
Name: Hayden Shaw
Trades: 0
I am creating a web form which will put info into my database. The problem i have it that i want be able to have the option to either use a drop down or a textbox input that will both input into the same database field. The idea is that if the required selection is not in the drop down menu people can type their own in the textbox. I have no idea how to do this. If someone could help i would greatly appreciate it.


I have included a copy of my code and a screenshot of how the form will look when completed.
Attached Images
File Type: jpg screenshot.JPG (51.5 KB, 9 views)
Attached Files
File Type: txt insert-advanced.txt (4.6 KB, 3 views)
__________________

Please login or register to view this content. Registration is FREE
ezhs8554 is offline
Reply With Quote
View Public Profile Visit ezhs8554's homepage!
 
 
Register now for full access!
Old 02-18-2008, 10:26 AM Re: Web Form Help - how can they user choose between a drop down or textbox?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Use an if function, for example:
PHP Code:
if(isset($_POST['hardware'])){
// get other

Or even better, put both of these in the shame field using an array:
PHP Code:
$hardware[0] = $_POST[form0]
$hardware[1] = $_POST[form1]

$hardware serialize($hardware);

// Now put $hardware into the database.
// To get array back to norm, use the unserialize function :) 
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Reply     « Reply to Web Form Help - how can they user choose between a drop down or textbox?
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11472 seconds with 13 queries