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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:01:53+00:00 2026-06-11T03:01:53+00:00

I Have a form which when submitted needs to go to the page and

  • 0

I Have a form which when submitted needs to go to the page and then show one of 4 hidden divs depending on the page.

Here is the form

<form>
<input id="place" name="place" type="text">
<input name="datepicker" type="text" id="datepicker">
<input type="submit" name="submit" id="submit" />
</form>

Here is the page

<div id="brighton">
<p>Brighton</p>
</div>

<div id="devon">
<p>Devon</p>
</div>

<div id="search">
<p>search</p>
</div>

<div id="variety">
<p>variety</p>
</div>

So if Brighton is typed into the place input i need the form to submit the page and show the Brighton div and if Devon is typed in to show the Devon div etc and if the 2/12/2012 is typed into the date picker input and Brighton into the place input it goes to the page and shows the variety div.

i also need it so if the 1/12/2012 is typed in to the date picker input the page redirects to the page show.html.

any help would be greatly appreciated

thanks.

  • 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-11T03:01:55+00:00Added an answer on June 11, 2026 at 3:01 am

    This is easy if you know PHP at all. It looks like you need a good, easy start. Then you will be able to achieve this in seconds.

    Refer to W3SCHOOLS PHP Tutorial.

    To achieve what you have mentioned, first make the following changes in your form:

    <form action="submit.php" method="post">
    <input id="place" name="place" type="text">
    <input name="datepicker" type="text" id="datepicker">
    <input type="submit" name="submit" id="submit" />
    </form>
    

    Create a new file called submit.php and add the following code:

    <?php
    $place = $_POST['place'];
    $date = $_POST['datepicker'];
    
    if ($date == '1/12/2012') {
      header('Location: show.html');
      exit;
    }
    ?>
    
    <?php if ($place == 'Brighton''): ?>
    <div id="brighton">
    <p>Brighton</p>
    </div>
    
    <?php elseif ($place == 'Devon'): ?>
    <div id="devon">
    <p>Devon</p>
    </div>
    
    <?php elseif ($place == 'search'): ?>
    <div id="search">
    <p>search</p>
    </div>
    
    <?php elseif ($place == 'Variety'): ?>
    <div id="variety">
    <p>variety</p>
    </div>
    <?php endif; ?>
    

    Now the above example is not the complete solution, but it gives you an idea as to how you can use if-then-else construct in PHP to compare values and do as desired.

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

Sidebar

Related Questions

I have one page which has Only one Dropdown name called MydropDown.My submitted form
I have a form which is submitted to a PHP page. The data from
I have an html form which when it gets submitted it calls a JavaScript
I have an HTML form which, when submitted by the user, will call a
I have a form which has three inputs when the page loads -- 2
I have a form with 2 sections, each of which starts out with one
I have the following code that generates my form on my html page <input
I have a form which contains some unique input fields and some others with
I have a form which I want to be 'resusable' for a variety of
I have a form which has a RichTextBox docked to the left and DataGridView

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.