Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2009, 12:37 PM   PM User | #1
Phil Jackson
Senior Coder

 
Join Date: Aug 2009
Location: Mansfield, Nottinghamshire, UK
Posts: 1,547
Thanks: 57
Thanked 148 Times in 147 Posts
Phil Jackson is on a distinguished road
AJAX activation on multipul drop dorwns

Hi i have the following code:

Code:
<script type="text/javascript">
jQuery(document).ready(hostCalc);
function hostCalc(){
	$("SELECT").change(function(){
		var diskSpace = jQuery("#diskSpace :selected").text();
		var bandwidth = jQuery('#bandwidth :selected').text();
		var subDomains = jQuery('#subDomains :selected').text();
		var additionalFTP = jQuery('#additionalFTP :selected').text();
		var mysqlDatabases = jQuery('#mysqlDatabases :selected').text();
		var emailForwarding = jQuery('#emailForwarding :selected').text();
		var AutoResponders = jQuery('#autoResponders :selected').text();
		var emailDistributionLists = jQuery('#emailDistributionLists :selected').text();
		var mailBoxes = jQuery('#mailBoxes :selected').text();
		var operatingSystem = jQuery('#operatingSystem :selected').text();
		var oneClick = jQuery('#oneClick :selected').text();
		
		$.ajax({
			type: "GET", 
			data: 'discSpace=' + discSpace + '&bandwidth=' + bandwidth + '&subDomains=' + subDomains + '&additionalFTP=' + additionalFTP + '&mysqlDatabases=' + mysqlDatabases + '&emailForwarding=' + emailForwarding + '&AutoResponders=' + AutoResponders + '&emailDistributionLists=' + emailDistributionLists + '&mailBoxes=' + mailBoxes + '&operatingSystem=' + operatingSystem + '&oneClick=' + oneClick, 
			url: 'hostCalc.php', 
			cache: false, 
			timeout: 1000, 
			error: function(){
			},
			success: 
			function(html){
				$("#cost").html(html);
			}
		});
	});
}
</script>
the hostCalc.php simply :
PHP Code:
<?php
echo "foo";
?>
i seem to get no response back from the php script. Anyone know why?
Phil Jackson is offline   Reply With Quote
Old 09-14-2009, 03:34 AM   PM User | #2
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
what does fiddler or firebug say comes back?

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 09-14-2009, 03:36 AM   PM User | #3
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
Instead of getting every single form element, you can use seralize.

Code:
$("#formId").serialize();
Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:51 PM.


Advertisement
Log in to turn off these ads.