Trigger autocomplete without submitting a form

后端 未结 10 634
甜味超标
甜味超标 2020-11-29 01:44

I am writing a very simple web app with three text inputs. The inputs are used to generate a result, but all the work is done in Javascript, so there is no need to submit a

10条回答
  •  孤城傲影
    2020-11-29 02:05

    From what i searched.. it seems you need to identify the names. Some standard names like 'name', 'email', 'phone', 'address' are automatically saved in most browser.

    Well, the problem is, browsers handle these names differenetly. For example, here is chrome's regex:

    • first name: "first.*name|initials|fname|first$"
    • email: "e.?mail"
    • address (line 1): "address.*line|address1|addr1|street"
    • zipcode: "zip|postal|post.*code|pcode|^1z$"

    But chrome also uses autocomplete, so you can customize the name and put an autocomplete type, but i believe this is not for custom fields..

    Here is chrome's standard

    And it's another thing in IE, Opera, and Mozilla. For now, you can try the iframe solution there, so you can submit it. (Maybe it's something semi-standard)

    Well, that's all i can help.

提交回复
热议问题