Lukes
Lukes

Reputation: 1

how to sent 2 parameter value in load jquery

 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

Answers (2)

Chathuranga K
Chathuranga K

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

Vinayak Phal
Vinayak Phal

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

Related Questions