Hello all!
I was hoping one of you clever folks would be able to help.
I'm actually pretty new to all aspects of development (this is about week 6), although I am managing to get to grips with most of the fundamentals, there are a few things that still throw me.
I've successfully managed to build a site and integrated Couch (which is awesome) however there is something I really just can't figure out how to do.
I've built a typical contact form and used Couch to 'process' it, however after submission of the form (which works fine and successfully shows a 'success' message) the fields of the form remain populated with the users input.
Is there a simple way to reset the form back to blank after submission?
I've included my forms code below, any help would be greatly appreciated - I know its a big ask, but if you could try and air on the simpler side it would be appreciated too.
Thanks again!
Ash
I was hoping one of you clever folks would be able to help.
I'm actually pretty new to all aspects of development (this is about week 6), although I am managing to get to grips with most of the fundamentals, there are a few things that still throw me.
I've successfully managed to build a site and integrated Couch (which is awesome) however there is something I really just can't figure out how to do.
I've built a typical contact form and used Couch to 'process' it, however after submission of the form (which works fine and successfully shows a 'success' message) the fields of the form remain populated with the users input.
Is there a simple way to reset the form back to blank after submission?
I've included my forms code below, any help would be greatly appreciated - I know its a big ask, but if you could try and air on the simpler side it would be appreciated too.
- Code: Select all
<cms:form action='' method='post' id='contact_form'>
<cms:if k_success >
<p id='mail_success' class='success' style='display:block'>Thank you! Your message has been received. Our support team will get back to you as soon as possible.</p>
<cms:send_mail from=k_email_from to=k_email_to subject='Contact Form Message'>
<strong>The following message has been sent for your attention: </strong>
<cms:show k_success />
</cms:send_mail>
</cms:if>
<label>Full Name</label>
<cms:input type="text" name='name' id='name' required='1' placeholder="John Smith" />
<cms:if k_error_name>
<p id='name_error' class='error' style='display:block'><i class="fi-prohibited"></i> PLEASE ENTER YOUR NAME</p>
</cms:if>
<label>Email</label>
<cms:input type="text" name='email' id='email' required='1' validator='email' placeholder="name@example.com" />
<cms:if k_error_email>
<p id='email_error' class='error' style='display:block'><i class="fi-prohibited"></i> PLEASE ENTER A VALID EMAIL ADDRESS</p>
</cms:if>
<label>Your Message</label>
<cms:input type='textarea' name='message' id='message' required='1' rows="10" cols="50" placeholder="Type your message here."></cms:input>
<cms:if k_error_message>
<p id='message_error' class='error' style='display:block'><i class="fi-prohibited"></i> PLEASE ENTER A MESSAGE</p>
</cms:if>
<input type="submit" class="small button large-push-10 small-push-6" value="Send Message" />
</cms:form>
Thanks again!
Ash