4 <div id="brapi_home_trial_search_div">
7 <input name="brapi_home_trials_locationid" id="brapi_home_trials_locationid" class="form-control" type="text" placeholder="LocationDbId e.g. 23" value="23"/>
8 <input name="brapi_home_trials_programid" id="brapi_home_trials_programid" class="form-control" type="text" placeholder="ProgramDbId e.g. 134" value="134"/>
9 <button class="btn btn-primary" name="brapi_home_trial_search_submit" id="brapi_home_trial_search_submit">Get Trials</button>
11 <div id="brapi_trials_result_div">
18 jQuery(document).ready(function() {
19 jQuery("#brapi_home_trial_search_submit").click(function() {
22 'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/trials?locationDbIds='+jQuery('#brapi_home_trials_locationid').val()+'&programDbIds='+jQuery('#brapi_home_trials_programid').val(),
24 'success': function(response) {
25 console.log(response);
26 brapi_create_paginated_table(response.result.data, response.metadata.pagination, 'brapi_trials_result_div', jQuery('#brapi_home_url_select').val()+'/brapi/v1/trials?locationDbId='+jQuery('#brapi_home_trials_locationid').val()+'&programDbId='+jQuery('#brapi_home_trials_programid').val(), undefined);
29 error: function(response) {
30 alert('An error occurred');