Hi, in a "contact us" page named contact.htm that has some input textboxes, a submit button, and a reset button. When I fill out the fields and click Submit, it posts to an asp page that sends an email. What I want to do is to clear out the input fields after the .asp page is done, so if the user clicks the back button to go back to the fill-in page, the fields are all blank.

How would I do that?

Thanks,
Craig

The 'response redirect' can help you.

<%
response.redirect('contact.html')
%>

When you submit the form and it will process in 'asp' file and then, redirect to the 'contact.html'. It make the browser refresh and all fields are clear.

Hi Zero13, thanks for your response.

I had actually, in the meantime, found a way to do this on another site. Simply put, in the "onLoad" attribute of the htm page's body tag, I called a JavaScript function that called the form's Reset button, like this:

var i;
for (i = 0; (i < document.forms.length); i++) {
document.forms.elements.click();
}

('Reset Button' is the name of the reset button)

Craig

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.