Jump to content

Search the Community

Showing results for tags 'add select using jquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, I need to implement a function that will allow a user to add a <select> (dropdown) box when clicking a button and be able to keep adding a <select> when clicking the button. I am totally new to jQuery but this is what I have so far: <label for="characteristic" id="characteristic_label">Add Characteristic</label> <input type="button" id="buttonToAddChar" value="Add" style="cursor:pointer;" /> <div id="newCharacteristic" style="display:block; width:100px;"></div> <script> $("#buttonToAddChar").click(function () { var newChar = $("<select/>"); $(newChar).append("<option><?PHP echo "Select from list"; ?></option>"); $("#newCharacteristic").append(newChar); }); </script> This does work (screenshot attached) but I need to add the following features: 1. The options for each <select> dropdown should come from a mySQL query (and each additional <select> added should not contain the option chosen in previous <select> dropdowns) 2. Add the option for a user to remove a <select> previously added (I think another function, right?) 3. Submit/save the option chosen in each <select> to a mySQL table (I can do this using a form, but what is the best way to get the option chosen from each dropdown?) Am I going in the right direction? How difficult is this going to be for a jQuery newbie? Any help would be greatly appreciated. Thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.