Any way to add a code to clear the form fields after the form has been sent? The form works but I think it will be a great idea to clear the form fields that way the user doesn't keep clicking on the sent button and send me a million emails cause the fields are filled rather than empty...
The html form will not be sent if the form fields are empty...any idea?
Here's that script that sends the form...
<script type="text/javascript">
//<![CDATA[
function send(form) {
new Ajax.Request('?a=contact', {
method: 'post',
parameters: $(form).serialize(true),
onSuccess: function(transport) {
var resp = transport.responseText.substr('success='.length);
if ('true' == resp)
$('contactFormResponse').update('<font color="#62ccff">Your message succesfully sent!</font>');
else {
resp = resp[0].toUpperCase() + resp.substr(1);
$('contactFormResponse').update(resp);
}
}
});
return false;
}
//]]>
</script>