0

我在这里有一个网站。

我的身体里有以下...

<!--Search Start-->
<div class="search-inner">
<form onsubmit="showpell_13_14(this.efc.value); return false;">
    <input type="text" value="Enter 13-14 PELL Score" onfocus="if(this.value == 'Enter 13-14 PELL Score') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Enter 13-14 PELL Score'; }" class="search-input-bg" id="textfield"  />
    </form>
</div>
<!--Search End-->

你会在网站的左上角找到这个框。

我正在尝试使用function showpell_13_14(efc) {位于 js 文件中的 this 调用脚本。这里有 JS 文件的链接。

它不工作。它所做的只是刷新页面。

4

1 回答 1

1

您输入字段的 ID 似乎不是很独特:“textfield”,但如果它是唯一的,您可以在标签的onsubmit属性中使用它,例如<form>

<form onsubmit="showpell_13_14(document.getElementById('textfield').value); return false;">

那是假设您实际上想要使用该输入字段的值进行计算...

于 2013-08-14T05:55:12.397 回答