0

I have a small form which retains the form fields when the form is submitted

  <input name="name" type="text" placeholder="Your Name" value="<?php print $_POST['name']; ?>" />

The problem is that when the user hits the back button the values are retained.

Is there a way to clear the post variable and if not what is the best way to clear the fields ($name == '', $name == null)

Thanks

chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192

1 Answers1

0

Use autocomplete="off" to disable the browser from populating the form input.