#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2008
    Posts
    186
    Rep Power
    7

    Basic HTML issues


    Hey Guys!

    i have a problem and have spent all night trying to solve this issue!

    http://temp.accesscontrolsystems.co.nz

    I have a form in the index page for "Request a Quote" this is a clone of the contact form. I then also have a contact form in the footer on he site. Both seem to send mail fine, however

    - The quote form displays the success message fine, but its the wrong message. It displays that all fields are required however they are all there and the message is sent.

    - The footer contact form on the other hand does the opposite almost. The message displays the correct message however on a new page which is incorrect. This should be working as the contact form does on the CONTACT page which is currently the only page working on the site.

    Can someone PLEASE helo me, Ive played around all night with the divs repositioning the

    <div id="widget-contactform-result" style="display: none;"></div>

    Any help much appreciated!

    Thanks Guys!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Posts
    119
    Rep Power
    32
    The first problem is because both forms have exactly the same id's and actions and call the exact same javascript so when you submit the quote form it is checking the javascript against the id's and required fields and as it is the same as the contact form and that form hasn't been complete and submitted and therefore displays the errors.

    You need to change your quote form id names etc from contact to quote in both the form and the javascript. Once you have this sorted it may help with your redirect problem.

    So, for example, change
    Code:
    <div id="widget-contactform-result" style="display: none;"></div>
    
    <form class="nobottommargin" id="widget-contactform" name="widget-contactform" action="functions/footer-email.php" method="post">
    To
    Code:
    <div id="widget-quoteform-result" style="display: none;"></div>
    
    <form class="nobottommargin" id="widget-contactform" name="widget-quoteform" action="functions/footer-email.php" method="post">
    And so on in your quote form and change the JS to
    Code:
    <script type="text/javascript">                            
                                
                                    $("#widget-quoteform").validate({
                                		submitHandler: function(form) {
                                			$(form).ajaxSubmit({
                                				target: '#widget-quoteform-result',
                                                success: function() {
                                                    $('#widget-quoteform').fadeOut(500, function(){
                                                        $('#widget-quoteform-result').fadeIn(500);
                                                    });
                                                },
                                                error: function() {
                                                    $('#widget-quoteform-result').fadeIn(500);
                                                }
                                			});
    `                            		}
                                	});                            
                                    
                                </script>

IMN logo majestic logo threadwatch logo seochat tools logo