this form does not work when i add the .js file to it. the php is working when i take the .js out and the form seems to look fine.

Will someone take a look at my .js file and tell me if they see what I am missing...

When I add the .js file to the header the submit button on the form does not have any functionality at all.

ill show the .js file


And just to be clear... the action in my form should reference the php file? and the ajax just does its thing in the back ground? correct?



Code:
    $(document).ready(function() {
$('#response').hide();
$('#submit').click(function(e) {
// prevent forms default action until
// error check has been performed
e.preventDefault();

// grab form field values
var valid = '';
var required = ' is required.';
var fname = $('#fname').val();
var lname = $('#lname').val();
var telephone = $('#telephone').val();
var cell = $('#cell').val();
var email = $('#email').val();
var signature = $('#signature').val();

// perform error checking
if(fname == '' || fname.length <= 2){
valid = '<p>Your first name' + required +'</p>'; 
}

if(lname == '' || lname.length <= 2){
valid = '<p>Your last name' + required +'</p>'; 
}

if(telephone == '' || telephone.length <= 7){
valid = '<p>Your phone' + required +'</p>';
}

if(cell == '' || cell.length <= 7){ 
valid = '<p>Your telephone ' + required +'</p>';
}

if(!email.match(/^([a-z0-9._-]+@[a-z0-9._-]+\.[a-z]{2,4}$)/i)){
valid += '<p>Your email' + required +'</p>'; 
}

if(signature == '' || message.length <= 5){
valid += '<p>Your signature' + required + '</p>'; 
}

// let the user know if there are erros with the form
if(valid != ''){
$('#response').removeClass().addClass('error').html('<strong>Please correct the errors below.</strong>' +valid).fadeIn('normal'); 
}
// let the user know something is happening behind the scenes
// serialize the form data and send to our ajax function
else{
$('#response').removeClass().addClass('processing').html('Sending message...').fadeIn('normal'); 
var formData = $('form').serialize();
submitForm(formData); 
} 

});
});

// make our ajax request to the server
function submitForm(formData){
$.ajax({ 
type: 'POST',
url: 'actions/appSubmit.php', 
data: formData,
dataType: 'json',
cache: false,
timeout: 7000,
success: function(data){
$('#response').removeClass().addClass((data.error === true) ? 'error' : 'success').html(data.msg).fadeIn('fast'); 
if($('#response').hasClass('success')){
setTimeout("$('#response').fadeOut('fast')", 5000);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
$('#response').removeClass().addClass('error').html('<p>There was a<strong> ' + errorThrown +'</strong> error due to a<strong> ' + textStatus +'</strong> condition.</p>').fadeIn('fast');
}, 
complete: function(XMLHttpRequest, status){$('form')[0].reset();}
}); 
};
then the .php file


Code:
   <?php 
sleep(2);
//Sanitize incoming data and store in variable

$date =  trim(stripslashes(htmlspecialchars ($_POST['date'])));		
$position =  trim(stripslashes(htmlspecialchars ($_POST['position'])));	
$email =  trim(stripslashes(htmlspecialchars ($_POST['email'])));	
$experience = trim(stripslashes(htmlspecialchars ($_POST['experience'])));	
$fname =  trim(stripslashes(htmlspecialchars ($_POST['fname'])));	
$lname =  trim(stripslashes(htmlspecialchars ($_POST['lname'])));	
$mname =  trim(stripslashes(htmlspecialchars ($_POST['mname'])));	
$dob =  trim(stripslashes(htmlspecialchars ($_POST['dob'])));	
$dl =  trim(stripslashes(htmlspecialchars ($_POST['dl'])));	
$address =  trim(stripslashes(htmlspecialchars ($_POST['address'])));	
$city =  trim(stripslashes(htmlspecialchars ($_POST['city'])));	
$state =  trim(stripslashes(htmlspecialchars ($_POST['state'])));	
$zip =  trim(stripslashes(htmlspecialchars ($_POST['zip'])));	
$telephone =  trim(stripslashes(htmlspecialchars ($_POST['telephone'])));	
$cell =  trim(stripslashes(htmlspecialchars ($_POST['cell'])));	
$ename =  trim(stripslashes(htmlspecialchars ($_POST['ename'])));	
$elname =  trim(stripslashes(htmlspecialchars ($_POST['elname'])));	
$ephone =  trim(stripslashes(htmlspecialchars ($_POST['ephone'])));	
$ecell =  trim(stripslashes(htmlspecialchars ($_POST['ecell'])));	
$availability =  trim(stripslashes(htmlspecialchars ($_POST['availability'])));	
$previous =  trim(stripslashes(htmlspecialchars ($_POST['previous'])));	
$company =  trim(stripslashes(htmlspecialchars ($_POST['company'])));	
$title =  trim(stripslashes(htmlspecialchars ($_POST['title'])));	
$supervisor =  trim(stripslashes(htmlspecialchars ($_POST['supervisor'])));	
$supervisorphone =  trim(stripslashes(htmlspecialchars ($_POST['supervisorphone'])));	
$leaving =  trim(stripslashes(htmlspecialchars ($_POST['leaving'])));	
$sex =  trim(stripslashes(htmlspecialchars ($_POST['sex'])));	
$proof =  trim(stripslashes(htmlspecialchars ($_POST['proof'])));	
$signature =  trim(stripslashes(htmlspecialchars ($_POST['signature'])));	
$datesign =  trim(stripslashes(htmlspecialchars ($_POST['datesign'])));	
$humancheck = $_POST['humancheck'];
$honeypot = $_POST['honeypot'];


if ($honeypot == 'http://' && empty($humancheck)) {		
			
		//Validate data and return success or error message
		$error_message = '';	
		}
		if (empty($fname)) {
				   
				    $error_message .= "<p>Please provide your first name, provide at least 2 characters in this field.</p>";	
					
		if (empty($lname)) {
				   
				    $error_message .= "<p>Please provide your last name, provide at least 2 characters in this field.</p>";			   
		}
		if (empty($telephone)) {
				   
				    $error_message .= "<p>Please provide your phone number with area code.</p>";			   
		}				
		if (empty($cell)) {
					
					$error_message .= "<p>Please provide cell with area code</p>";
		}	
			if (empty($signature)) {
					
					$error_message .= "<p>Please provide E signature</p>";
		}				
		$reg_exp = "/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,4}$/";
		
		if (!preg_match($reg_exp, $email)) {
				    
					$error_message .= "<p>A valid email address is required.</p>";			   
		}
		
			
		if (!empty($error_message)) {
					$return['error'] = true;
					$return['msg'] = "<h3>Oops! The request was successful but your form is not filled out correctly.</h3>"
					.$error_message;					
					echo json_encode($return);
					exit();
					
		} else {
			
				//Prepare information from form to be sent
				$to = 'admin@skylinestaffingservices.com';
				$from = 'admin@skylinestaffingservices.com';	
				$headers = 'MIME-VERSION: 1.0' . '\n';
				$headers .= 'From: $from' . '\n';	
				$subject = 'New Application Submission';
				$body = 'Date: ' .$date . PHP_EOL;
				$body .= 'Position: ' .$position . PHP_EOL;
				$body .= 'Email: ' .$email . PHP_EOL;
				$body .= 'Experience: ' .$experience . PHP_EOL;
				$body = 'Name: ' .$fname . PHP_EOL;
				$body .= 'Last Name: ' .$lname . PHP_EOL;
				$body .= 'Middle Name: ' .$mname . PHP_EOL;
				$body .= 'DOB: ' .$dob . PHP_EOL;
				$body = 'DL: ' .$dl . PHP_EOL;
				$body .= 'Address: ' .$address . PHP_EOL;
				$body .= 'city: ' .$city . PHP_EOL;
				$body .= 'State: ' .$state . PHP_EOL;
				$body = 'Zip: ' .$zip . PHP_EOL;
				$body .= 'telephone: ' .$telephone . PHP_EOL;
				$body .= 'cell: ' .$cell . PHP_EOL;
				$body .= 'Emergency Name: ' .$ename . PHP_EOL;
				$body = 'Emergency Last Name: ' .$elname . PHP_EOL;
				$body .= 'Emergency Phone: ' .$ephone . PHP_EOL;
				$body .= 'Emergency Cell: ' .$ecell . PHP_EOL;
				$body .= 'Availability: ' .$availability . PHP_EOL;
				$body = 'Previously Worked For SSS: ' .$previous . PHP_EOL;
				$body .= 'Company: ' .$company . PHP_EOL;
				$body .= 'Title: ' .$title . PHP_EOL;
				$body .= 'Supervisor: ' .$supervisor . PHP_EOL;
				$body .= 'Supervisor Phone Number: ' .$supervisorphone . PHP_EOL;
				$body .= 'Reason For Leaving: ' .$leaving . PHP_EOL;
				$body .= 'Gender: ' .$sex . PHP_EOL;
				$body .= 'Documents To Work: ' .$proof . PHP_EOL;
				$body .= 'E Signature: ' .$signature . PHP_EOL;
				$body .= 'E Date: ' .$datesign . PHP_EOL;
				
				// Form data was successfull so we will now send admin email and return message to the user
				if(mail($to, $subject, $body, $headers, '-f admin@skylinestaffingservices.com')) { 
							  
					$return['error'] = false;
					$return['msg'] = "<p>We will be in touch soon " .$fname .".</p>"; 
					echo json_encode($return);
				
		} else {
	
	$return['error'] = true;
	$return['msg'] = "<h3>Oops! We are having trouble submitting your application. Please try us directly at admin@skylinestaffingservices.com</h3>";	
	echo json_encode($return);
		}
		}

}

?>