我希望在单个 jsp 中实现 key down 和 focusout 方法.. 我必须满足以下要求..
要求:
(keyDown)>当用户在文本框中输入大于“四个字符”(即产品名称)时,我在弹出窗口中打开并且必须显示我在文本框中输入的相关产品名称。
(focusout) > 当用户输入准确的产品名称(可能是 7 个字符或 8 个字符)并进行聚焦时,我必须得到准确的产品名称..
所以我实现了这两件事,并在下面查看我的代码..
$("productName").keydown(function()
{
//when productName.length >4 i have show the pop up and show the related productName in that code..
//passing greater than 4 character to ajax and and retriving related products from ajax response.. and showing in the pop up
}
$("productName").focusout(fuction()
{
//when the user entering exact product name(it may be 7 character or 8 character) and make a focusout and have the pass the value to ajax and have retrieve exact productName details from the ajax response
}
面临的问题
- 当我尝试输入确切的产品名称(可能是 6 或 7 个字符)时,正在调用向下键,因为它超过了四个字符。
那么我该如何克服这些事情..这两个要求一次满足是可行的吗?
请帮我解决这个问题