hi
we have one problem while using drop down list in PHP. We have a drop down list, after the selection of the items in that drop down list we want another drop down list to be displayed based on the selection of the first drop down list, we r not able to generate the second drop down list...... please help us and reply soon.......
hemasow
0
Newbie Poster
Recommended Answers
Jump to PostHere is a piece of code with the basic concept for that:
<? echo '<form method="post"> <select name="box1"> <option value="apple">Apple <option value="orange">Orange <option value="lemon">Lemon </select><input type="submit" value="Submit"></form>'; if (isset($_POST['box1'])) { if ($_POST['box1']=='apple') { echo '<form method="post"> <select name="box2"> <option value="1">1 <option value="2">2 <option value="3">3 </select><input type="hidden" name="box1" …
Jump to PostThen just use a little javascript to submit the form like the following:
<? echo '<form method="post" name="form1"> <select name="box1" onchange="document.form1.submit()"> <option value="apple">Apple <option value="orange">Orange <option value="lemon">Lemon </select></form>'; if (isset($_POST['box1'])) { if ($_POST['box1']=='apple') { echo '<form method="post"> <select name="box2"> <option value="1">1 <option value="2">2 <option value="3">3 </select><input type="hidden" …
All 6 Replies
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
hemasow
0
Newbie Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
hemasow
0
Newbie Poster
hemasow
0
Newbie Poster
cwarn23
387
Occupation: Genius
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.