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

  • Home
  • SEARCH
  • 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 5980573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:49:13+00:00 2026-05-22T21:49:13+00:00

I want to create a script that does the following: When answering questions via

  • 0

I want to create a script that does the following:

When answering questions via a radio, drop-down, or checkbox, the script checks
When selecting a radio button (or dropdown, or any form element except text and textarea) it checks if the given option will make the script to ask more questions.

Example:

A checkbox in front of ‘Call me back’, which when checked shows 2 more fields (a dropdown with all available countries, and a textfield for their phonenumber)


Another example:

(Let’s say we’re end-user IT support)

A dropdown menu where the user can select on what topic they want support (i.e. hardware, software). Then when the user selects a topic, it will show a additional field with more topics (ex: when user selects hardware, they get phone, computer, etc.), which on their turn shows extra fields for serial number, maybe OS’es and so forth


I think I’ll be able to figure out how to do it in PHP and SQL, I just need a bit of a push in the right direction with HTML and jQuery:AJAX
I hope I’m clear enough in what I want the script to do..

Thanks in advance! 🙂

  • 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-05-22T21:49:14+00:00Added an answer on May 22, 2026 at 9:49 pm

    Assuming some html structure like this:

    <div id="question-1" class="top-question">
        What do you want?<br>
        <select>
            <option value='thing'>thing</option>
            <option value='item'>item</option>
        </select>
        <div id="question-1a" class="sub-question">
            How many of them?<br>
            <select>
                <option value='5'>five</option>
                <option value='10'>ten</option>
            </select>
        </div>
    </div>
    

    And using jQuery library (which makes life lots easier in cases like this) you can do this:

    $('.sub-question').hide()
    $('.top-question').bind('change',function(){
        $('.sub-question').show()
    })
    

    As demonstrated here: http://jsfiddle.net/xtUk6/

    Ajax is not necessary here. The concept is that you have all the form fields there on the page, just visually removed. Then, each question has it’s own unique id that can be identified when the form is posted back to the server and handled there in your case by php.

    Using Ajax is possible, but unless you have millions of questions to select from according to some very complex set of input scenarios, it would cause delay whilst it is constantly fetching the next question from the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a script that parses or makes sense of apache's error
I want to create a simple http proxy server that does some very basic
I'm currently working on a PHP/MySQL script that does the following, in this order:
I have a Silverlight solution that I want to create a build script for.
I want create a drop shadow around the canvas component in flex. Technically speaking
I want to create a function that performs a function passed by parameter on
I want to create an allocator which provides memory with the following attributes: cannot
I want to create a Java application bundle for Mac without using Mac. According
I want to create a client side mail creator web page. I know the
I want to create a draggable and resizable window in JavaScript for cross browser

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.