Advertisement
Guest User

Untitled

a guest
Jun 1st, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. function ajaxcall1(type){
  2.  
  3. var parameters = 'hotel_category='+type;
  4. var argUrl = 'ajax_hotels.php';
  5. $.ajax({
  6. url: argUrl,
  7. type: 'POST',
  8. data: parameters,
  9. success: function (str) {
  10. $(".hc1").html(str);
  11. //alert(parameters);
  12. }
  13.  
  14. });
  15. }
  16.  
  17. <select name="hotel" id="hotel" onChange="ajaxcall1(this.value)">
  18. <option value="1">-Select-</option>
  19. <?php
  20.  
  21. $sql = "select category from tbl_category";
  22. $retval = mysql_query($sql, $conn );
  23. if(! $retval )
  24. {
  25. die('Could not get data: ' . mysql_error());
  26. echo 'Could not get data: ' . mysql_error();
  27. }
  28. while($row = mysql_fetch_assoc($retval,MYSQL_ASSOC)){ $category1= $row['category'];?>
  29. <option value="<?php echo $category1;?>"><?php echo $category1;?></option>
  30. <?php } ?>
  31. </select>
  32. <td>Hotels from selected Category : </td><td id="td12" class="hc1">
  33. <select name="hotelname" id="hotelname">
  34.  
  35. </select>
  36. </td>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement