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,444
  • 2
  • 25
  • 44
LeBlaireau
  • 14,709
  • 30
  • 95
  • 169

1 Answers1

0

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