gpt4 book ai didi

javascript - 需要帮助将 3 个列表菜单中的文本放入单个文本框中

转载 作者:行者123 更新时间:2023-11-28 10:20:34 24 4
gpt4 key购买 nike

我是 javascript 新手,我所有的书都回到了美国。我有一个 dokuwiki 网站,我想要 3 个列表菜单![示例][1] 当用户输入学校级别时,它会将菜单值放入文本框中;当用户输入年级时,它会在文本框中输入学校级别,最后将主题放入年级级别之后的文本框中。我发现了一些示例代码,我只能使用 1 个文本框来使用它,但我无法让它使用所有三个文本框,任何想法都将不胜感激。

<html>    
<script language="JavaScript">

<!-- Begin
function go_to_description() {
if (document.createpage.select.options[0].selected) {
window.location.href = "URL";}
else if (document.createpage.select2.options[1].selected) {
window.location.href = "http://www.google.com";}
else if (document.createpage.select3.options[2].selected) {
;}
return true;
}
function textValue() {
var searchInteger, searchString
testInteger=document.createpage.select.selectedIndex
testString=document.createpage.select.options[testInteger].text
if (testInteger=document.createpage.select.options[0].selected) {
document.createpage.qsearch__in.value = "Nowhere to GO?";} else {
document.createpage.qsearch__in.value = "" + testString +":"
}
}
// End -->
</script>

<form name="createpage">
<form action="/dw3/doku.php" accept-charset="utf-8" class="search" id="dw__search" method="input"><div class="no"><input type="hidden" name="do" value="search" />
<select name="select" on onChange="textValue()" id="select" input type="text">
<option>Select School Level</option>
<option value="elementary_school_1st_grade:art:">elementary_school_1st_grade:art</option>
</select>
</select><input name="id" type="text" class="edit" id="qsearch__in" accesskey="f" title="[F]" size="40" /><input type="submit" value="Search" class="button" title="Search" /><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>
<div class="clearer"></div>
</html>

最佳答案

您是否使用多项选择?你的例子只显示了一个。

为了到达我认为您想去的地方,您需要存储三个不同的值。尝试创建三个变量,并在设置 qsearch__in.value 的位置将变量连接成一个字符串。

关于javascript - 需要帮助将 3 个列表菜单中的文本放入单个文本框中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5762950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com