Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003
    Posts
    137

    Unanswered: how to [Add More..] for thos combobox?

    Hi,

    I have the following combobox which populate countries from my database. I want to allow the user to Click a link to Add more of the same combobox so he can add multiple countries.

    How can I do this please...

    <select name="cboJobLocation" style="width: 100%" required>
    <option value="">[Unspecified..]</option>
    <?php
    $mysql_command = "CALL sp_populate_country()";
    $mysql_query = $mysql_connection->prepare($mysql_command);

    $mysql_query->execute();

    while($mysql_row = $mysql_query->fetch())
    {
    ?>
    <option value="<?php echo $mysql_row['country_code_alpha2']; ?>" <?php if ($mysql_row['country_code_alpha2'] == $company_country) { echo 'selected'; } ?>><?php echo $mysql_row['country_name']; ?></option>
    <?php } ?>
    </select>

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Sounds like you shouldn't be using a select box but instead use checkboxes. This will allow the user to pick more than one option.
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2003
    Posts
    137
    can I have a checkbox <select? so it will be dropdown with checkbox items?

    or else what's the best way to do it?

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    <select> is designed for picking a single item.
    <input type="checkbox" /> is designed for selecting multiple items.

    There are other options available in some Javascript libraries but you should always design your sites functionality to work without JS and then add JS on after to "pretty" things up and offer enhanced functionality to those users/browsers that support JS.
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •