[Ask] Option dan Input

Discussion in 'Desain Web dan Programming' started by xpreborn, 16 Nov 2015.

Thread Status:
Not open for further replies.
  1. xpreborn

    xpreborn Poster 2.0

    Messages:
    183
    Likes Received:
    4
    Trophy Points:
    18
    Selamat malam, saya izin bertanya lagi yach Om,
    Bisa ga yach dalam satu field bisa ada option dan input,
    Jadi, misalnya gini,
    1. Jika sudah ada ditable database nilai yg sama maka akan diambil nilai tersebut (muncul di drop down option) namun jika belum ada bisa kita ketik manual nilainya,
    2. Yang sudah berjalan kurang lebih seperti ini (option)
    Code:
    <label>Name :</label>
    <input type="text" name="name" id="name" required="required" placeholder="Please Enter Name"/><br/><br />
    
    <label>Group:</label><br />
    
    <select name="groupa" id="groupa" style='font: bold 14px verdana; color:blue;'>
                    <option value=''>Select Group </option>
    <?php
    include("koneksi.php");
    
            $query = "SELECT groupa from datatable group by groupa";
            $result = mysqli_query($con, $query);
            while(list($groupa) = mysqli_fetch_row($result)) {
                    echo "<option value='$groupa'>$groupa</option>\n";
            }
            mysqli_free_result($result);
    ?>
            </select><br /> <br />
    
    <label>Location :</label>
    <input type="text" name="location" id="location" required="required" placeholder="Location"/><br/><br />
    Nah saya ingin dibagian group itu bisa kita ketik manual nama group nya jika misalnya belum ada pilihannya di option

    Terimakasih banyak Om
     
  2. xpreborn

    xpreborn Poster 2.0

    Messages:
    183
    Likes Received:
    4
    Trophy Points:
    18
    Solved
    Case closed
     
  3. junior riau

    junior riau Hosting Guru Web Hosting

    Messages:
    3,228
    Likes Received:
    515
    Trophy Points:
    113
    belum sempat jawab :v
     
    xpreborn likes this.
Loading...
Thread Status:
Not open for further replies.

Share This Page

Loading...