Question

Hello here is my form in HTML

<table border="0" cellpadding="4" cellspacing="4"><tr></tr>
    <form method="post" action="<?php echo base_url()?>book/room_book_proc/<?php echo $hotel_det[0]['hotel_id']?>" id="booking" name="booking">
    <tr><h3>Please Enter Your Visit Details: </h3></tr>
    <tr><th>Check In Date : </th>
    <td><input type="text" name="cn-date" id="cn-date" value="" class="jdpicker"/></td>
    </tr>

    <tr><th>Check Out Date : </th>
    <td><input type="text" name="co-date" id="co-date" value="" class="jdpicker"/></td>
    </tr>

    <tr><th>No of Person : </th><td></td>
    <tr><th></th><td>Adult: <select name="adult" class="">
    <option value="">Select</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    </select></td></tr>

    <tr><th></th><td>Children: <select name="child" class="">
    <option value="">Select</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    </select></td></tr>



    <tr><th>Room Type :</th>
    <?php $this->db->select("*");
        $this->db->from("b_room_type");
        $this->db->where("hotel_id",$hotel_det[0]['hotel_id']);
        $room_types=$this->db->get()->result_array();
        ?>
    <td><select name="toom_typ" class="">
    <option value="">Select</option>
    <?php foreach($room_types as $rooms)
        {?>
    <option value="<?php echo $rooms['room_type_id']?>"><?php echo $rooms['room_type_name']?></option>
    <?php }?>
    </select></td>
    </tr>

<input type="hidden" name="today" value="<?php echo date("Y-m-d");?>"  />
<tr><th></th><td><input type="submit" name="submit" value="Confirm" /></form></td></tr>
</table>

when i print the posted array in php page it only shows the values of fields : Adult, Children, and Room Type but not taking the values of Check In filed and Check Out field.

i am using a for date fields jquery date picker

what exactly going wrong? M i missing something??

Was it helpful?

Solution

I think it's happen because you are put the <form> tag inside the table.Try to put the <form> tag outside the table. And one more think, you are using hyphen (-) in the fields name which is causing problem remove it and you can use underscore (_) sign instead of hyphen (-).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top