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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:48:03+00:00 2026-06-07T10:48:03+00:00

I have this code: page.php: <?php include (‘include.php’); echo = ‘ <li> <select name=selector

  • 0

I have this code:

page.php:

<?php

include ('include.php');

echo = '
<li>
    <select name="selector" class="letter">
        <option value="a" selected="selected">$a</option>
        <option value="b">$b</option>
    </select>
</li>
';

echo = '
<li>
    <select name="a-numbers" class="number a-numbers">
        <option value="$a[1][1]">$a[1][2]</option>
        <option value="$a[2][1]">$a[2][2]</option>
    </select>
    <select name="b-numbers" class="number b-numbers">
        <option value="$b[1][1]">$b[1][2]</option>
        <option value="$b[2][1]">$b[2][2]</option>
    </select>
</li>
';

?>

&

include.php:

<?php

$array = array(
    "a" => array(
        "1" => array("aaa1-value","aaa1-text"),     
            "2" => array("aaa2-value","aaa2-text")      
        ),  
        "b" => array(
            "1" => array("bbb1-value","bbb1-text"),     
            "2" => array("bbb2-value","bbb2-text")      
        )   
    )
);

?>

If .letter>a is selected, .a-numbers list should be echo-printed; and if .letter>b is selected, .a-numbers list should be removed and .b-numbers should be printed.

Of course, I can create this scenario with JS and CSS display:none; however, I can’t use display:none here. So I have to remove elements from DOM, but I can’t.

Thanks for your attention.

  • 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-07T10:48:05+00:00Added an answer on June 7, 2026 at 10:48 am

    PHP cannot dynamically do any of this on it’s own. You will need to either use AJAX, which will actually send a request/response back to the server to populate the div.

    Or, you will need to load all possible content with the initial request/response and use javascript to dynamically show/hide the divs in question.

    You mention in your question that you cannot use display:none, so you may want to look into making an asychronous call back the webserver to populate the element.

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

Sidebar

Related Questions

i have this in my index.php include 'app/Core.php'; echo Core::getPageHtml(); in Core.php final class
Let's say I have this form : <form action=Change-status.php method=post> <select class=changeStatus name=changeStatus> <option
i have tried this code to redirect a php page.but it s not working
i have this simple code to load data from other php page using get
I have written this code for a search page in PHP and I would
I have this code here: case 'resource_list': if(file_exists('content.php')){ include('../ajax/content.php'); } else { die('does not
I have this testing code in PAGE A : <?php require_once('../mysite/php/classes/eventManager.php'); $x=new EventManager(); $y=$x->loadNumbers();
I have this code: include('./simplehtmldom/simple_html_dom.php'); $url = http://www.turismovenezia.it/Dove-Alloggiare/1322597142.html; $ch = curl_init(); // set URL
i have this code in indexSucces.php //some html for the main page <td width='48%'
I have this piece of code: Page.ClientScript.RegisterClientScriptInclude(this.GetType(), Guid.NewGuid().ToString(), this.ResolveUrl(~/Scripts/min.js)); When we push to our

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.