rgb192
asked on
a form that selects data and/or adds to menu choices
I want to design a form
there are two form input elements
option select
and
textbox
------------------
if user enters data into textbox
then
do not use option select
add to option select menu choices
mysql insert into categories column
else if user choses option select
use option select menu choice
------
sample data:
categories option select:
electronics
silverwear
bedding
textbox:
user enters new category: keyboards
now option select:
electronics
silverwear
bedding
keyboards
there are two form input elements
option select
and
textbox
------------------
if user enters data into textbox
then
do not use option select
add to option select menu choices
mysql insert into categories column
else if user choses option select
use option select menu choice
------
sample data:
categories option select:
electronics
silverwear
bedding
textbox:
user enters new category: keyboards
now option select:
electronics
silverwear
bedding
keyboards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works great
only lets user enter text data when dropdown is chosen
thanks
only lets user enter text data when dropdown is chosen
thanks
Your PHP code will be something like this:
if($_POST['text_input'] != ""){
//code to insert the new category option in the database
}else if($_POST['option_select']
//use the selected option menu
}