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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:45:43+00:00 2026-05-25T01:45:43+00:00

I am a newby so appologise for asking a basic question. I have a

  • 0

I am a newby so appologise for asking a basic question.

I have a php page – a ‘create new project’ page

There are some simple data such as name, deadline etc…

but depending on the type of the project I have 4 different ends (different pages?) in this FORM and I can’t find the solution for it.

Here is my code:

<h1>New Project</h1>
<form name="newpr">
New project name:<input type="text" placeholder="new project name..."><br />
New project end date:<input type="text" placeholder="date..."><br />
New project type:
<select name="menu" onChange="location=document.newpr.menu.options[document.newpr.menu.selectedIndex].value;" >
<?php 
$listdata = mysql_query("SELECT * FROM lists WHERE tag='prtype' ORDER BY listing ASC");
while($listresult = mysql_fetch_array($listdata))
{
if ($listresult["listing"]!="...") $link=$listresult["value"].".php";
else $link="";

echo "<option value='".$link."'>".$listresult["listing"]."</option> ";
}
?>
</select>
</form>

As you see the select list comes from Mysql and I would like a div under a form to be able to open page1.php or page2.php etc as user selects…

Thanks in advance

Andras

it might be ajax question…

  • 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-25T01:45:44+00:00Added an answer on May 25, 2026 at 1:45 am

    I’d solve this the following way

    <!-- using jQuery -->
    
    <h1>New Project</h1>
    
    <form method="" action="post">
        New project name:<input type="text" placeholder="new project name..."><br/>
        New project end date:<input type="text" placeholder="date..."><br/>
        New project type:
        <select name="menu">
            <?php 
            $listdata = mysql_query("SELECT * FROM lists WHERE tag='prtype' ORDER BY listing ASC");
            while($listresult = mysql_fetch_array($listdata))
            {
                $link = '';
                if($listresult['listing'] != '...') {
                    $links = $listresult['value'] . ".php";
                    echo "<option value='$link'>${listresult['listing']}</option>";
                }
            }
            ?>
        </select>
    
        <div id="page">
            <!-- container for loaded page -->
        </div>
    
        <script type="text/javascript">
            $("select[name=menu]").change(function() {
                var url = $("option:selected", this).val();
                // Load a page to the container
                $("#page").load(url);
            });
        </script>
    </form>
    

    Using jQuery I added on change handler on select box and if it’s changed it loads via ajax a page to the div container.

    And let me give you and advice – try to avoid mixing code and html. It leads to difficulties in further development and maintenance.

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

Sidebar

Related Questions

I have some simple code: function testing(){ for (a=1; a<=4; a++) { this[btn+a].enabled =
Does newly created user: create user John identified by secret; have some privileges? Or
ROR newby question: I've got a controller with the following action: # GET /organisations/new
So this is a really newby question. I have a step that looks like
Sorry for probably simple question but I'm a newby in Django and really confused.
I found a bunch of scripts in the project I have been newly assigned
I'm new to windows services, so pardon the basic nature of this post. I've
Okay, so ultimately I want a program where the user can input simple data
Please forgive the newb question. I am very new to .NET so don't assume
First of all I'm a total newby in visual basic, I needed to hack

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.