Hi Kamran,
I am trying to incorporate the contact form code we settled on last week and use it within twitter bootstrap modal.
I link to the modal which contains my form, fill out the info & click submit. The modal then closes and I do not know if it is successful or not. I have tried redirecting to the modal again but this does not seem to work. (Note: code below is just redirecting to page link)
Maybe it is not possible to keep modal open to show success or failure? See code below
I am trying to incorporate the contact form code we settled on last week and use it within twitter bootstrap modal.
I link to the modal which contains my form, fill out the info & click submit. The modal then closes and I do not know if it is successful or not. I have tried redirecting to the modal again but this does not seem to work. (Note: code below is just redirecting to page link)
Maybe it is not possible to keep modal open to show success or failure? See code below
- Code: Select all
<a href="#myModal" role="button" class="btn" data-toggle="modal">Contact Us Now</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Contact Us</h3>
</div>
<div class="modal-body">
<p><cms:form action=' ' method='post' id='contact_form' class='form'>
<!-- <form method="post" class="form"> -->
<div class="form-row">
<label class="form-label">Your Name</label>
<div class="form-item">
<cms:input type='text' name="name" id="name" value="" required='1' class="span5 small inputtext input_middle required" />
<cms:if k_error_name>
<p id='name_error' class='help'>Enter a Name</p>
</cms:if>
</div>
</div>
<div class="form-row">
<label class="form-label">Your Email</label>
<div class="form-item">
<cms:input type="text" id="email" name="email" value="" required='1' validator='email' class="span5 small inputtext input_middle required" />
<cms:if k_error_email>
<p id='email_error' class='help'>Enter a valid email address</p>
</cms:if>
</div>
</div>
<div class="form-row">
<label class="form-label">Select the Store You Wish to Contact</label>
<div class="form-item">
<cms:input type="dropdown" name="store" opt_values="Choose One | Dublin Rd. Pharmacy | Monksland" class="span5" />
<cms:if k_error_message>
<p id='store_error' class='help'>Please Select a Store</p>
</cms:if>
</div>
</div>
<div class="form-row">
<label class="form-label">Message</label>
<div class="form-item">
<cms:input type='textarea' cols="" rows="5" id="message" name="message" required='1' class="span5 large textarea textarea_middle required"></cms:input>
<cms:if k_error_message>
<p id='message_error' class='help'>Enter a message</p>
</cms:if>
</div>
</div>
<cms:if k_success >
<p id='mail_success' class='success'>Thank you. We will get back to you as soon as possible.</p>
<cms:send_mail from=k_email_from to=k_email_to subject='Feedback from your site'>
The following is an email sent by a visitor to your site:
<cms:show k_success />
</cms:send_mail>
<cms:set_flash name='success_msg' value="Thank you. We will get back to you as soon as possible." />
<cms:redirect url='http://www.netsmart.ie/dev/cp/contact.php#myModal' />
</cms:if>
</p>
</div>
<div class="modal-footer">
<div class="button-row">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<input type="submit" id='send' class="btn btn-info">
</div>
<!-- </form> -->
</cms:form>
</div>
</div>
<!-- End Modal -->