Connected as user : Tony
You selected the procedure : lg_resultsretrieval
Enter procedure input variables :
Parameter1: starttime - timestamp without time zone
Parameter2: endtime - timestamp without time zone
Parameter3: in_sourceindicator - integer
Parameter4: keyword - character varying
我写了一个jQuery函数的文字区域的:
这个div,使一个AJAX调用一个servlet后,作为附加如下:
//submits only when the textbox value is valid
$("#response").on("change", function() {
$("#Execute").click(function() {
if ($(".txtarea").val() == this.defaultValue)
{
alert("Please insert a valid value");
return false;
}
});
$("txtarea")
.focus(function() {
if (this.value === this.defaultValue) {
console.log('inside focus function');
this.value = '';
}
})
.blur(function() {
if (this.value === '') {
this.value = this.defaultValue;
}
});
});
问题是,上面的代码不虽然jquery的文档中工作,它表示对函数用于动态加载的Elemen TS。我如何使它工作?请建议
2014-03-12
Karthik
+0
1)不存在与元素的id'Execute' 2)没有标签'txtarea'的元素 –
+0
DIVS没有变化事件。 –
+0
@epascarello:尽管如此,'change'事件似乎传播到子元素的'div'元素。在这种情况下'textarea'元素。也许这是特定于浏览器的行为?值得测试,我想。 –