Jump to content

input box retains data after reload


niche
 Share

Recommended Posts

Why does my input box retain data when I reload the page?

Edited by niche
Link to comment
Share on other sites

Here's the script for the search input:

<div style="margin-left:60px;">  <div><form action="search2.php" method="post" >  <input type="text" name="search" value="Keyword or Item #"/><br />  <select size="1" type="text" name="kind" >    <option>Everything</option>     <option>Business</option>    <option>Category</option>  </select><br />  <input type="submit" id="mysubmitbut"  />  </form></div></div>

Link to comment
Share on other sites

so, is search2.php a different page then the one the form is on? If it's a different page, then I'm not sure what the problem is without seeing more.

Link to comment
Share on other sites

Here's search2.php:

<?phpecho var_dump($_POST);$search = $_POST['search'];echo $search;?>

It's just a placeholder right now.I expected my search script to display the value of the input box (Keyword or Item #) each time I pressed the page reload/refresh button on my browser. Except, what ever I typed in that box remains and I don't know why.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...