从输入文本字段转到URL [英] Go to url from input text field
问题描述
用户在我的文本字段中输入文本。如果他的文本与我的列表中的文本匹配,则一旦他点击提交按钮,他就会被发送到特定的URL。
我希望我的文本确定用户的文本从我提供的列表输入。我的列表将有很多文本/网址,它会继续增长,所以我希望能够编辑列表
示例:
输入文字:aaaa,转到URL1
输入文字:mmne,转到URL2
输入文字:lhfj,转到URL3
输入文字:tigf,转到URL4
输入文字:gred,转到URL5
有人可以帮帮我吗?
User inputs a text in my text field. If his text matches a text in my "list," he is sent to a specific URL once he hits the submit button.
I want mine to determine the user's text input from a list I provide. My list will have a lot of texts/urls and it will continue to grow, so I want to be able to edit the list
Example:
input text: aaaa, go to URL1
input text: mmne, go to URL2
input text: lhfj, go to URL3
input text: tigf, go to URL4
input text: gred, go to URL5
Can anyone help me with this please?
推荐答案
由于列表是由您将控制的固定值组成的,因此文本框全部错误。你需要一个< select> list。
使用这些函数调度到其中一个javaScript函数来更改页面,例如location.assign()。
然而,编码取决于你。
Since the list is made of fixed value which you will control then a text box is all wrong. You need a <select> list.
Use these to dispatch to one of the javaScript functions to change pages, such as location.assign().
The coding, however, is up to you.
这篇关于从输入文本字段转到URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!