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 440693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:53:54+00:00 2026-05-12T20:53:54+00:00

I’m a beginner and trying to generate as much of my own code as

  • 0

I’m a beginner and trying to generate as much of my own code as possible without just constantly asking others to write it for me, so with regard to this question I’m looking for hints in the right direction, rather than outright working examples. You people are all very talented, but I learn best if I reason it out myself. Should I hit a brick wall, I’ll be sure to ask specifics. 🙂

I want to build a form for MySQL query that has a rather lot of checkbox options, not all of which most users would be interested in at one time for one search. Rather than present a massive form, I’d like the first few options to control how many of the subsequent choices are available to select from, without going to a new page (if possible).

Hypothetical example: a database of movie actors, wherein each actor’s nationality is included, and by choosing an assortment of actors the form query will return all movies they appear in together.

ACTOR NATIONALITY
[] Any
[] German
[] Russian
[] British
[] American
[] Japanese
[] Chinese

at first no further information is displayed. Should the user check [] Any then the full form is revealed:

German   Russian   British   American   Japanese    Chinese
[]GER1    []RUS1    []BRIT1   []AMER1    []JPN1      []CHN1
[]GER2    []RUS2    []BRIT2   []AMER2    []JPN2      []CHN2
[]GER3    []RUS3    []BRIT3   []AMER3    []JPN3      []CHN3
 etc.

but if the user is only interested in say, German & Japanese actors, he would check those two boxes and the following would then appear below:

German   Japanese 
[]GER1    []JPN1
[]GER2    []JPN2
[]GER3    []JPN3 

am I making sense?

My coding knowledge at this point is confined to PHP/MySQL, so a solution that only incorporates PHP would be ideal, but if javascript is required please point me in the right direction and I will endeavor to add the necessary knowledge!

Thank you!

EDIT – yes, all the checkbox info is being pulled from a database

  • 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-12T20:53:54+00:00Added an answer on May 12, 2026 at 8:53 pm

    I agreed with Sabeen; javascript is the way to go, but I would use ajax methods rather than hiding other form elements…

    You can use js to "listen" to events happening to the first checkbox group (ie onclick, onmouseover, whatever) and when a change is made, you can use ajax methods to send the form data to a small php script. This script then figures out which sub-menus build, and returns the relevant html fragment to the calling php script. Js takes this response and manipulates the DOM to add the new checkbox group to the page, all without the need for an entire page reload.

    If you’re new to the world of js / ajax then I can throughly recommend jQuery. Other flavours of js framework (off the top of my head) include Prototype, MooTools, Dojo.

    I hope that wan’t too vague, you did say you wanted a push in the right direction, rather than concrete examples! 🙂

    EDIT.
    I should mention that I’ve assumed the data that’s driving these checkboxes is coming from a db. If not, then Sabeen’s method is simpler to implement and incurs a much smaller execution overhead.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.