Jump to content

Clear Form Button


essjay_d12

Recommended Posts

You might want to use javascript to clear the fields you want clearing instead. Like this:
[code]<script type="text/javascript">

function clearForm()
{
    document.formName.name.value = "";
    document.formName.email.value = "";
}

</script>

<form name="formName" action="fileName.php" method="get">
Name: <input type="text" name="name"><br />
Email: <input type="text" name="email"><br />
Special Field: <input type="text" name="special" value="doesn't get cleared" /><br />
<input type="button" value="Reset" onClick="clearForm()">
</form>[/code] To add more follow this template:
[code]document.[name of form here].[name of input field].value = "";[/code]
Link to comment
https://forums.phpfreaks.com/topic/6110-clear-form-button/#findComment-22346
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.