@All, Greetings from India!!!
I have a contact form in a modal. What I need to do is this:
1. Open the Form in a Modal : DONE
2. Fill the form:
2.1: Check for Errors, if errors are encountered, allow the person to correct them.
2.2: If no errors, submit the form and display success message
I referred to the post: viewtopic.php?f=4&t=7417, but I feel I am doing something wrong.
Here is my form code:
Also, I feel i should mention this. My form is on the Page View (Blog Page View, from the tutorials). So when I submit the form, it redirectes to the list view.
Thanks in advance.
Regards,
GenXCoders
I have a contact form in a modal. What I need to do is this:
1. Open the Form in a Modal : DONE
2. Fill the form:
2.1: Check for Errors, if errors are encountered, allow the person to correct them.
2.2: If no errors, submit the form and display success message
I referred to the post: viewtopic.php?f=4&t=7417, but I feel I am doing something wrong.
Here is my form code:
- Code: Select all
<!-- Button to open the form -->
<button class="btn btn-danger button genxcoders-fc-white" type="button" data-toggle="modal" data-target="#site-visit">
<i class="fa fa-map-marker"></i> Request Site Visit
</button>
<!-- Button to open the form -->
<!-- Site Visit Form -->
<div class="modal fade" id="site-visit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<cms:form action='' name="site-visit" id="site-visit-pp">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel" class="no-margin">VISIT PROJECT: <cms:show k_page_title /></h4>
</div>
<div class="modal-body">
<cms:capture into='my_buffer'>
<div class="row">
<div class="col-md-4">
<label>First Name * <cms:if k_error_first-name><small><span id='first-name_error' class="error" style="display: inline-block;">Required</span></small></cms:if></label>
<div class="ptop-10"></div>
</div>
<div class="col-md-8">
<cms:input name="first-name" id="first-name" type="text" class="input" required='1' />
<div class="ptop-10"></div>
</div>
<div class="col-md-4">
<label>Last Name * <cms:if k_error_last-name><small><span id='lastname_error' class="error" style="display: inline-block;">Required</span></small></cms:if></label>
<div class="ptop-10"></div>
</div>
<div class="col-md-8">
<cms:input name="last-name" id="last-name" type="text" class="input" required='1'/>
<div class="ptop-10"></div>
</div>
<div class="col-md-4">
<label>Mobile * <cms:if k_error_mobile><small><span id='mobile_error' class="error" style="display: inline-block;">Required</span></small></cms:if></label>
<div class="ptop-10"></div>
</div>
<div class="col-md-8">
<cms:input name="mobile" id="mobile" type="text" class="input" required='1' />
<div class="ptop-10"></div>
</div>
<div class="col-md-4">
<label>Visit Date * <cms:if k_error_vdate><small><span id='vdate_error' class="error" style="display: inline-block;">Required</span></small></cms:if></label>
<div class="ptop-10"></div>
</div>
<div class="col-md-8">
<cms:input name="vdate" id="vdate" type="datetime" class="input" required='1' />
<div class="ptop-10"></div>
</div>
</div>
</cms:capture>
</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 debug='1' from=k_email_from to=k_email_to subject='Project Visit Request - <cms:show k_page_title />'>
The following is an email sent by a visitor to your site:
<cms:show k_success />
</cms:send_mail>
<cms:else />
<cms:show my_buffer />
</cms:if>
<div class="modal-footer">
<cms:if "<cms:not k_success />" >
<input type="submit" id="send" class="btn btn-danger button genxcoders-fc-white" value="<i class="fa fa-send"></i> Submit Request" />
</cms:if>
</div>
</cms:form>
</div>
</div>
</div>
Also, I feel i should mention this. My form is on the Page View (Blog Page View, from the tutorials). So when I submit the form, it redirectes to the list view.
Thanks in advance.
Regards,
GenXCoders