message dialog and js
[sgn.git] / mason / brapiclient / studies_detail.mas
blob4410cf514f8b9b9982d81650af5eb419139d2d02
1 <%args>
2 </%args>
4 <div id="brapi_home_study_detail_div">
6     <h4>Study Details</h4>
7     <input name="brapi_home_studydbid" id="brapi_home_studydbid" class="form-control" type="text" placeholder="StudyDbId e.g. 137" value="137"/>
8     <button class="btn btn-primary" name="brapi_home_studydbid_submit" id="brapi_home_studydbid_submit">Get Details</button>
9     <br/><br/>
10     <div id="brapi_studies_detail_result_div">
11     </div>
13 </div>
15 <script>
17 jQuery(document).ready(function() {
18     jQuery("#brapi_home_studydbid_submit").click(function() {
19         jQuery.ajax( {
20           'url': jQuery('#brapi_home_url_select').val()+'/brapi/v1/studies/'+jQuery('#brapi_home_studydbid').val(),
21           'method': 'GET',
22           'success': function(response) {
23             console.log(response);
24             brapi_create_table(response.result, 'brapi_studies_detail_result_div', undefined);
26           },
27           error: function(response) {
28             alert('An error occurred');
29           }
30         });
31     });
32 });
34 </script>