Sendmail form not working properly..probably something simple

I know this is a done deal, and ginerjm thought I knew and was holding back, but I honestly didn’t realise that Javascript was impacting the form. When you said ralph.m that ‘All of the content on the site is served up by Javascript’, I decided to check the ‘js’ folder and I found some code that looks like it relates to the form in the ‘custom.js’ file.

I just wanted to let you guys know that, and thank you again for your diligence and patience. :slight_smile:

See below (custom.js)

"function loadPage(url){
if (url){
if (!$(‘Content’).html()){
$(‘Content’).hide().load(url, function(){
$(‘<span id=“body_loader”/>’).appendTo(‘#container’).animate({left: 0}, 400);
$(‘#dcontent’).fadeOut(‘slow’, function(){
$(‘#body_loader’).fadeOut(‘fast’, function() {
$(this).remove();
});
$(‘Content’).fadeIn(‘normal’);
$(‘#dcontent’).html(‘’);
initLinks();
initJS(url);
});
});
} else {
$(‘#dcontent’).hide().load(url, function(){
$(‘<span id=“body_loader”/>’).appendTo(‘#container’).animate({left: 0}, 400);
$(‘Content’).fadeOut(‘slow’, function(){
$(‘#body_loader’).fadeOut(‘fast’, function() {
$(this).remove();
});
$(‘#dcontent’).fadeIn(‘normal’);
$(‘Content’).html(‘’);
initLinks();
initJS(url);
});
});
}
}
}

function initJS(url){
switch (url){
case ‘home.html’:
$(‘#navigation ul > li’).hover(
function() {$(‘ul’, this).stop(true,true).slideDown(300);},
function() {$(‘ul’, this).stop(true,true).slideUp(300);}
)
if($(‘#cycle’).length) {
$(‘#cycle’).cycle({
easing: ‘easeOutQuint’,
fx: ‘scrollHorz’,
next: ‘#next_slide’,
prev: ‘#prev_slide’,
animation:700,
pager: false,
timeout:5500
});
}

	break;
	case 'about.html':
		$('#navigation ul &gt; li').hover(
			function() {$('ul', this).stop(true,true).slideDown(300);},
			function() {$('ul', this).stop(true,true).slideUp(300);}
		)
				if($('#slider').length) {
			$('#slider').nivoSlider({directionNav: false, pauseTime:5000, captionOpacity: 1,effect: 'fade',});
		}	

	
	
	$('.scroll-pane').jScrollPane({showArrows: true});
	
			break;
	case 'collection.html':
		$('#navigation ul &gt; li').hover(
			function() {$('ul', this).stop(true,true).slideDown(300);},
			function() {$('ul', this).stop(true,true).slideUp(300);}
		)			 
	
	$('.carousel').uCarausel({show:5,buttonClass:'car-button'	
		,duration:800,
		easing:'easeOutQuint'})
		
		$('.carousel1').uCarausel({show:5,buttonClass:'car-button1'	
		,duration:800,
		easing:'easeOutQuint'})	

$(‘.lightbox-image’).prettyPhoto({theme:‘light_square’,autoplay_slideshow:false,autoplay:false,social_tools:false,animation_speed:‘normal’})

    break;	
	case 'news.html':
		$('#navigation ul &gt; li').hover(
			function() {$('ul', this).stop(true,true).slideDown(300);},
			function() {$('ul', this).stop(true,true).slideUp(300);}
		)	
       $('.scroll-pane').jScrollPane({showArrows: true});

	break;	
	case 'contacts.html':
		$('#navigation ul &gt; li').hover(
			function() {$('ul', this).stop(true,true).slideDown(300);},
			function() {$('ul', this).stop(true,true).slideUp(300);})				

			/* Contact Form */
			function checkemail(emailaddress){
				var pattern = new RegExp(/^(("[\\w-\\s]+")|([\\w-]+(?:\\.[\\w-]+)*)|("[\\w-\\s]+")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i); 
				return pattern.test(emailaddress); 
			}

			jQuery('#contactform #formsend').click(function(){
				var $name 	= jQuery('#name').val();
				var $email 	= jQuery('#email').val();
				var $subject = jQuery('#subject').val();
				var $url = jQuery('#url').val();
				var $message = jQuery('#message').val();
				var $contactemail = jQuery('#contactemail').val();
				var $contacturl = jQuery('#contacturl').val();
				var $mywebsite = jQuery('#contactwebsite').val();

				if ($name != '' && $name.length &lt; 3){ $nameshort = true; } else { $nameshort = false; }
				if ($name != '' && $name.length &gt; 30){ $namelong = true; } else { $namelong = false; }
				if ($email != '' && checkemail($email)){ $emailerror = true; } else { $emailerror = false; }
				if ($subject != '' && $subject.length &lt; 3){ $subjectshort = true; } else { $subjectshort = false; }
				if ($subject != '' && $subject.length &gt; 100){ $subjectlong = true; } else { $subjectlong = false; }
				if ($url == ''){ $url = 'none'; }
				if ($message != '' && $message.length &lt; 3){ $messageshort = true; } else { $messageshort = false; }

				jQuery('#contactform .loading').animate({opacity: 1}, 250);

				if ($name != '' && $nameshort != true && $namelong != true && $email != '' && $emailerror != false && $subject != '' && $subjectshort != true && $subjectlong != true && $message != '' && $messageshort != true && $contactemail != '' && $contacturl != '' && $mywebsite != ''){ 
					jQuery.post($contacturl, 
						{type: 'form', contactemail: $contactemail, name: $name, email: $email, subject: $subject, website: $url, message: $message, mywebsite: $mywebsite}, 
						function(data){
							jQuery('#contactform .loading').animate({opacity: 0}, 250);
							jQuery('div.contform').fadeOut('slow');
							jQuery('#name, #subject, #url, #email, #message').val('');
							jQuery('#contactform div.form_info div.form_error').hide();
							jQuery('.box').hide();
							jQuery('.info_box').fadeIn('fast');
							jQuery('html, body').animate({scrollTop:250}, 'slow');
							jQuery('.info_box').delay(5000).fadeOut(1000, function(){ 
								jQuery('div.contform').fadeIn('slow');
							});
						}
					);

					return false;
				} else {
					jQuery('#contactform .loading').animate({opacity: 0}, 250);
					jQuery('.box').hide();
					jQuery('.error_box').fadeIn('fast');
					jQuery('html, body').animate({scrollTop:250}, 'slow');
					jQuery('.error_box').delay(5000).fadeOut('slow');

					if ($name == ''){ 
						jQuery('#name').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#name').parent().parent().parent().find('div.defaulterror').show(); 
					} else if ($nameshort == true){ 
						jQuery('#name').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#name').parent().parent().parent().find('div.shorterror').show(); 
					} else if ($namelong == true){ 
						jQuery('#name').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#name').parent().parent().parent().find('div.longerror').show(); 
					} else { 
						jQuery('#name').parent().parent().parent().find('div.form_error').hide();
					}

					if ($email == ''){ 
						jQuery('#email').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#email').parent().parent().parent().find('div.defaulterror').show(); 
					} else if ($emailerror == false){ 
						jQuery('#email').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#email').parent().parent().parent().find('div.invaliderror').show(); 
					} else { 
						jQuery('#email').parent().parent().parent().find('div.form_error').hide(); 
					}

					if ($subject == ''){ 
						jQuery('#subject').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#subject').parent().parent().parent().find('div.defaulterror').show(); 
					} else if ($subjectshort == true){ 
						jQuery('#subject').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#subject').parent().parent().parent().find('div.shorterror').show(); 
					} else if ($subjectlong == true){ 
						jQuery('#subject').parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#subject').parent().parent().parent().find('div.longerror').show(); 
					} else { 
						jQuery('#subject').parent().parent().parent().find('div.form_error').hide(); 
					}

					if ($message == ''){ 
						jQuery('#message').parent().parent().parent().parent().parent().find('div.form_error').hide(); 
						jQuery('#message').parent().parent().parent().parent().parent().find('div.defaulterror').show(); 
					} else if ($messageshort == true){ 
						jQuery('#message').parent().parent().parent().parent().parent().find('div.form_error').hide();
						jQuery('#message').parent().parent().parent().parent().parent().find('div.shorterror').show(); 
					} else { 
						jQuery('#message').parent().parent().parent().parent().parent().find('div.form_error').hide();
					}

					return false;
				}
			});
	break;
 }   

}

function initLinks(){
$(‘#navigation ul a, .logo a’).click(function(){

	loadPage($(this).attr('href'));
	return false;
});

}

/********************************* DOM Ready ************************************/

$(function(){
loadPage(‘home.html’);
});

/********************************* DOM End ************************************/ "