Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ajaxcall1(type){
- var parameters = 'hotel_category='+type;
- var argUrl = 'ajax_hotels.php';
- $.ajax({
- url: argUrl,
- type: 'POST',
- data: parameters,
- success: function (str) {
- $(".hc1").html(str);
- //alert(parameters);
- }
- });
- }
- <select name="hotel" id="hotel" onChange="ajaxcall1(this.value)">
- <option value="1">-Select-</option>
- <?php
- $sql = "select category from tbl_category";
- $retval = mysql_query($sql, $conn );
- if(! $retval )
- {
- die('Could not get data: ' . mysql_error());
- echo 'Could not get data: ' . mysql_error();
- }
- while($row = mysql_fetch_assoc($retval,MYSQL_ASSOC)){ $category1= $row['category'];?>
- <option value="<?php echo $category1;?>"><?php echo $category1;?></option>
- <?php } ?>
- </select>
- <td>Hotels from selected Category : </td><td id="td12" class="hc1">
- <select name="hotelname" id="hotelname">
- </select>
- </td>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement