Advertisement
payen83

Search Location

Jun 8th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. /*----HTML----*/
  2.  
  3. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  4.  
  5. <div align="center">
  6. <img src="http://appgen.gamma.malaysia.gov.my/uploads/5709/media/170608/43186241.png" width="200">
  7. </div>
  8.  
  9. <div class="form-group">
  10. <label for="nama">Nama Tempat</label>
  11. <input type="text" class="form-control" id="nama">
  12. </div>
  13. <div class="form-group">
  14. <label for="dari">Dari</label>
  15. <input id="date1" type="date" class="form-control">
  16. </div>
  17. <div class="form-group">
  18. <label for="hingga">Hingga</label>
  19. <input id="date2" type="date" class="form-control">
  20. </div>
  21.  
  22.  
  23. <button type="submit" id="btnSubmit" class="btn btn-default">Cari</button>
  24.  
  25.  
  26.  
  27. /*----END HTML----*/
  28.  
  29. /*----JS----*/
  30.  
  31. $("#btnSubmit").tap(function(){
  32.  
  33. var location = $("#nama").val();
  34. var from_date = $("#date1").val();
  35. var to_date = $("#date2").val();
  36.  
  37. alert(date1);
  38.  
  39. var KEY = "720db083ad63fae92e54360a5a379a981118f99b";
  40. var SEARCHOPS = 6398;
  41.  
  42. var loginObj = {};
  43. var configObj = {}
  44.  
  45. loginObj.location = location;
  46. loginObj.from_date = from_date;
  47. loginObj.to_date = to_date;
  48.  
  49. configObj = { bodyParams: loginObj };
  50.  
  51. callApi(SEARCHOPS, KEY, "post", configObj)
  52. .then(function(result){
  53.  
  54. console.log(result);
  55.  
  56. }), function(error){
  57. console.log(error)
  58. }
  59.  
  60.  
  61. })
  62.  
  63. /*----END JS----*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement