Add <options> dynamically to HTML <select> tag in Jquery UI dialog widget
I require to add options dynamically to drop down menu in a jquery ui dialog. My code is in php so i'll have to pass the variables to javascript function for jq开发者_StackOverflow中文版uery and use these values to make the drop down list. How do I do that?
- Send the options out of PHP as an array or JSON decoded data
- In Javascript when you create a dialog box you can run a function on dialog open. Use this as an opportunity to populate options.
- Select the /select box/ element and append select box with options.
If need help visit this post
精彩评论