我想根据用户提供的输入获取文本字段数据。
这是我的代码。此代码将在下拉列表中选择数据(select),但我需要在文本字段中获取数据。
function getEventname() {
var clid = $('#eventid').val();
console.log("i am ok" + clid);
$.ajax({
type: "GET",
url: "EduManage.jsp",
data: {
control: 'ajax',
ch: '1',
key: '1_0a1m_1',
eventid: clid
},
success: function(data) {
data = data.trim();
addOptions(eventname, data.split(", "), data.split(", "));
}
});
}
<td class="bg1">Event Id
<edu:prnStar/>
<a href="#" onClick="MM_openWindow('EduManage.jsp?control=search1&searchno=1_0s3&position=1','','width=790,height=420,left=0,top=70,scrollbars=1,location=no,status=no,resizable=yes')"><img src="../images/util/final.gif" name="search" width="20" height="20" alt="Search" border="0"></a>
</td>
<td class="bg1" width="25%">
<edu:input name="eventid" type="text" id="eventid" size="10" maxlength="10" onblur="getEventname()" />
</td>
<td class="bg1" width="40%"> Event Name
<edu:prnStar/>
</td>
<td class="bg1" width="25%"><input type="text" name="eventname" id="eventname">
</td>
在密钥'1_0a1m_1
'中,我正在获取正在获取数据的查询
SELECT eventname FROM cam_eventdetail WHERE eventid=111