Jump to content

input box retains data after reload


niche

Recommended Posts

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

That's a browser feature. Some browsers do that in case a user accidentally clicked a link and wants to hit back, or if they accidentally reloaded the page.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...