(PHP) Not all form values POST'ing - driving me mad!

Associate
Joined
2 Nov 2007
Posts
488
Hey,

This is driving me mad - i would REALLY appreciate some help. Im building a contact form, which is all well and good but the thing is, two of my 9 fields arent being sent to the PHP script? You can see the form here. As far as i can see, everything is fine. Ive tried adding in extra fields, and they arent being POST'ed either? What is going on?

EDIT: i wasnt post'ing in the JS. What an idiot!
 
Last edited:
The problem is with your javascript. I've never used ajax/jquery before but my guess is add title and message here:

Code:
jQuery(document).ready(function(){
	
	$('#contactform').submit(function(){
	
		var action = $(this).attr('action');
		
		$('#contactform #submit').attr('disabled','disabled').after('<img src="assets/ajax-loader.gif" class="loader" />');
		
		$("#message").slideUp(750,function() {
		$('#message').hide();			
		[b]
		$.post(action, { 
			firstName: $('#firstName').val(),
			lastName: $('#lastName').val(),
			email: $('#email').val(),
			company: $('#company').val(),
			country: $('#country').val(),
			phone: $('#phone').val(),
			website: $('#website').val(),
			comments: $('#comments').val(),
		},[/b]
			function(data){
				document.getElementById('message').innerHTML = data;
				$('#message').slideDown('slow');
				$('#contactform img.loader').fadeOut('fast',function(){$(this).remove()});
				$('#contactform #submit').attr('disabled',''); 
				if(data.match('success') != null) $('#contactform').slideUp('slow');
				
			}
		);
		
		});
		
		return false; 
	
	});
	
});
 
Last edited:
Back
Top Bottom