Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8357595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:31:44+00:00 2026-06-09T10:31:44+00:00

I have a drop down menu with dynamically set values from the database: When

  • 0

I have a drop down menu with dynamically set values from the database:

When a value is selected how could I make it load a specific view dependent on what the selected option is?

I now have it loading a specific view dependent on what option is selected:

Code:

        if (isset($_REQUEST['general_options'])) {

            $page = strtolower(str_replace(" ", "", $_REQUEST['general_options']));


            $this->load->view( $page, $data, FALSE);
        }

How could I dynamically produce a form with specific questions dependent on what question is selected?

HTML:

<label for="general_options">Quote Type: </label>
    <select name="general_options" id="general_options">

        <option value="Graphic Design">Graphic Design</option>


        <option value="Content Management System">Content Management System</option>


        <option value="Shopping Cart">Shopping Cart</option>


        <option value="E-Mail Marketing">E-Mail Marketing</option>

            </select>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T10:31:45+00:00Added an answer on June 9, 2026 at 10:31 am

    I think php will be overkill for this. I have used jquery for this. you can find the jsfiddle here

    <label for="general_options">Quote Type: </label>
        <select name="general_options" id="general_options">
            <option value="graphic">Graphic Design</option>
            <option value="content">Content Management System</option>
            <option value="shopping">Shopping Cart</option>
            <option value="marketing">E-Mail Marketing</option>
    </select><br/>
    
    <div id="graphic" style="display:none;" class="questions">
        <p>Graphic content 1</p>
        <p>Graphic content 2</p>
        <p>Graphic content 3</p>
    </div>
    
    <div id="content" style="display:none;" class="questions">
    <p>CMS content 1</p>
    <p>CMS content 2</p>
    <p>CMS content 3</p>
    </div>
    
    <div id="shopping" style="display:none;" class="questions">
    <p>shopping content 1</p>
    <p>shopping content 2</p>
    <p>shopping content 3</p>
    </div>
    
    <div id="marketing" style="display:none;" class="questions">
    <p>marketing content 1</p>
    <p>marketing content 2</p>
    <p>marketing content 3</p>
    </div>
    

    and the jquery Code

    $(document).ready(function() {
         $('#general_options').change(function() {
    
          theVal = $("#general_options").val();
         $('div.questions').each(function(){
    
            if(this.id == theVal){
                $('div.questions').hide();
                $('#'+this.id).show();
            }
        });         
    
      });   
    
    });​
        ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a drop down menu that I am dynamically populating based on values
I have built a drop-down menu here http://dev.driz.co.uk/jsonmenu/ that uses JSON to dynamically build
I have a drop down menu. Has product types. Product types have associated value
I have a drop down menu, that a user selects a criteria from, based
Currently have a drop down menu that is activated on a hover (from display:none
I have a drop down menu with 3 values. each has an option id.
I need to make tabs that also have drop down menu and requirements are
I have a normal WinForms ToolStripDropDownButton's drop down menu that is populated dynamically. In
I have a drop-down menu that are dynamically added through WordPress. It looks like
I have a drop down menu and on postback, I cannot get the selected

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.