Reputation: 1
var siteid = $("#OperationSiteId option:selected").val();
$("#OperationSiteequipmentId").load("<?php echo $this->Html->url(array('controller'=>'Operations', 'action'=>'equipment_dropdown')) ?>/"+$(equipment).val()+"/"+$(siteid).val()
Please correct me what i have done wrong , i could not get siteid value.
for example : equipment value is 5 and site id value is 175
Upvotes: 0
Views: 43
Reputation: 226
You dont need to get the siteid value again on the load. Since you have retrieved the siteid to var siteid. you can use the same value.
var siteid = $("#OperationSiteId option:selected").val();
$("#OperationSiteequipmentId").load("<?php echo $this->Html->url(array('controller'=>'Operations', 'action'=>'equipment_dropdown')) ?>/"+$(equipment).val()+"/"+siteid);
Upvotes: 1
Reputation: 8919
$("#OperationSiteequipmentId").load( url [, callBackFunc ]);
The syntax for load is a URL, and optional callback function. If you want to pass 2 parameter in URL it is perfectly fine. Still it will be the part of the URL.
e.g http://example.com?equipment=5&siteId=175
You've to generate this as a single URL and pass it. Rest all will work fine. Please try like this. This should work fine
Upvotes: 1