How can I create an editable dropdownlist in HTML?

前端 未结 11 1096
终归单人心
终归单人心 2020-11-29 01:51

I\'d like to create a text field with a dropdown list that lets the user choose some predefined values. The user should also be able to type a new value or select a predefin

11条回答
  •  Happy的楠姐
    2020-11-29 02:28

    I am not sure there is a way to do it automatically without javascript.

    What you need is something which runs on the browser side to submit your form back to the server when they user makes a selection - hence, javascript.

    Also, ensure you have an alternate means (i.e. a submit button) for those who have javascript turned off.

    A good example: Combo-Box Viewer

    I had even a more sophisticated combo-box yesterday, with this dhtmlxCombo , using ajax to retrieve pertinent values amongst large quantity of data.

提交回复
热议问题