• Hey – so I created a form on my website in order to get some information from my clients. Everything is looking good, but for some reason when I click submit, it doesn’t send the email.

    Here is the code

    <div id="inquire" class="section">
    		<div class="inner-wrapper">
    
    			<!-- Add your steps -->
    			<div class="step">
    				<div class="header">
    					<h3>01</h3>
    					<p>What services do you need?</p>
    				</div>
    				<ul class="choices multis">
    					<li><input type="checkbox" value="Personal / Portfolio Website" name="choices1" /><label><span>Personal / Portfolio Website</span></label></li>
    					<li><input type="checkbox" value="HTML Website" name="choices1" /><label><span>Personal / Portfolio Website</span></label></li>
    					<li><input type="checkbox" value="Website with CMS" name="choices1" /><label><span>Website with CMS</span></label></li>
    					<li><input type="checkbox" value="eCommerce Website" name="choices1" /><label><span>eCommerce Website</span></label></li>
    					<li><input type="checkbox" value="Digital Graphic" name="choices1" /><label><span>Digital Graphic</span></label></li>
    					<li><input type="checkbox" value="Custom Logo" name="choices1" /><label><span>Custom Logo</span></label></li>
    				</ul>
    			</div><!-- // .step -->
    			<div class="step">
    				<div class="header">
    					<h3>02</h3>
    					<p>When do you need it done?</p>
    				</div>
    				<ul class="choices singles">
    					<li><input type="radio" value="Less than a week" name="choices2" /><label><span>Less than a week</span></label></li>
    					<li><input type="radio" value="1 to 2 weeks" name="choices2" /><label><span>1 to 2 weeks</span></label></li>
    					<li><input type="radio" value="Within a month" name="choices2" /><label><span>Within a month</span></label></li>
    					<li><input type="radio" value="1 to 2 months" name="choices2" /><label><span>1 to 2 months</span></label></li>
    					<li><input type="radio" value="Take your time" name="choices2" /><label><span>Take your time</span></label></li>
    				</ul>
    			</div><!-- // .step -->
    			<div class="step">
    				<div class="header">
    					<h3>03</h3>
    					<p>Enter your contact information and/or comments you may have.</p>
    				</div>
    				<ul class="fields">
    					<li><span class="required">*</span><input type="text" value="Name" id="name" name="name" class="clear-focus" /></li>
    					<li><span class="required">*</span><input type="text" value="Email" id="email" name="email" class="clear-focus" /></li>
    					<li><input type="text" value="Phone #" id="phone" name="phone" class="clear-focus" /></li>
    					<li class="textbox"><textarea class="clear-focus" id="comments">Comments</textarea></li>
    					<li>
    						<input type="hidden" id="sendto_email" name="sendto_email" value="[email protected]" />
    						<input type="submit" id="submit" value="Send Message" />
    						<div class="processing"></div>
    					</li>
    				</ul>
    				<div class="checkboxerror">Please make at least one selection.</div>
    				<div class="errormsg">Sorry, your inquiry was not sent.</div>
    			</div><!-- // .step -->
    
    			<div id="confirmation">
    				<div class="header">
    					<h3>Inquiry Sent<span>.</span></h3>
    				</div>
    				<div class="message">
    					<p>Thanks so much. We'll get back to you with further details after reviewing your inquiry.</p>
    				</div>
    			</div>

    Here is the code in my global.js file:

    // Inquiry form submission
    	$('#inquire').find('input[type=submit]').live('click', function() {
    
            // Inquire container
            var $inquire = $(this).parent().parent();
    
            // Form values
            var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
            var email = $inquire.find('#email');
            var emailVal = email.val();
            var myemailVal = $inquire.find('#sendto_email').val();
            var name = $inquire.find('#name');
    		var nameVal = name.val();
    		var dname = name.prop('defaultValue');
            var phone = $inquire.find('#phone');
    		var phoneVal = phone.val();
    		var comments = $inquire.find('#comments');
    		var commentsVal = comments.val().replace(/(<([^>]+)>)/ig,"");
            var error = false;
            var errormsg = $('.errormsg').html();
    
            // Check email for error
            if (!emailReg.test(emailVal)) {
            	//show error
            	email.addClass('red');
            	error = true;
            }
            // Check if name is empty
            if ((nameVal == '') || (nameVal == dname)) {
            	//show error
            	name.addClass('red');
            	error = true;
            }
            if (error == true) {
            	alert(errormsg);
            	return false;
            }

    Any ideas? Whenever I click submit it keeps repeating “Sorry the inquiry was not sent.”

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with Contact form on HTML website’ is closed to new replies.