A simple contact form with validation
-
Hi I hope somone can help with my dilema I am using this code to load an external page (contact form ) into an ajax panel I have tried several (contact forms) some from this website however when I submit the form I get errors either saying it cannot find the page or it just refreshed to the main default page
<script type="text/javascript">
$(document).ready(function () {$('#panel1').slidePanel({ triggerName: '#trigger1', position: 'fixed', triggerTopPos: '475px', panelTopPos: '495px', ajax: true, panelOpacity: 0.8, speed: 'slow', clickOutsideToClose: true, ajaxSource: '/ContactUs/Default.aspx' }); });
</script>
this is the contact form I am trying to use
<head id="Head1" runat="server">
<title>Contact Us</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script src="js/jquery.blockUI.js" type="text/javascript"></script>
<script type="text/javascript">
$.validator.setDefaults({
submitHandler: function() {
$.blockUI({
message: "Thank you!
We'll get in touch with you asap.
",
fadeIn: 500,
fadeOut: 500,
timeout: 3000,
showOverlay: false,
centerX: true,
centerY: true,
css: {
width: '350px',
right: '10px',
border: 'none',
padding: '5px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .6,
color: '#fff'
}
});
this.document.form.submit();
}
});$().ready(function() { // validate the comment form when it is submitted $("#contactForm").validate({ rules: { email: { required: true, email: true } } }); });
</script>
< -
Hi I hope somone can help with my dilema I am using this code to load an external page (contact form ) into an ajax panel I have tried several (contact forms) some from this website however when I submit the form I get errors either saying it cannot find the page or it just refreshed to the main default page
<script type="text/javascript">
$(document).ready(function () {$('#panel1').slidePanel({ triggerName: '#trigger1', position: 'fixed', triggerTopPos: '475px', panelTopPos: '495px', ajax: true, panelOpacity: 0.8, speed: 'slow', clickOutsideToClose: true, ajaxSource: '/ContactUs/Default.aspx' }); });
</script>
this is the contact form I am trying to use
<head id="Head1" runat="server">
<title>Contact Us</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script src="js/jquery.blockUI.js" type="text/javascript"></script>
<script type="text/javascript">
$.validator.setDefaults({
submitHandler: function() {
$.blockUI({
message: "Thank you!
We'll get in touch with you asap.
",
fadeIn: 500,
fadeOut: 500,
timeout: 3000,
showOverlay: false,
centerX: true,
centerY: true,
css: {
width: '350px',
right: '10px',
border: 'none',
padding: '5px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .6,
color: '#fff'
}
});
this.document.form.submit();
}
});$().ready(function() { // validate the comment form when it is submitted $("#contactForm").validate({ rules: { email: { required: true, email: true } } }); });
</script>
<Remember that the file which loads the contactform has to be in the same folder as your Contacts.ashx. Or else it won't work (404, file not found) If it's not in the same path/folder you have to change the action-attribute in the form-tag.
-------------------- When Chuck Norris' dreams come true, your worst nightmares begin.