我正在尝试让Ben Keen的ProtV工作的RSV。我发现了一个suggestion for Ben Keen's component但是,我在使用Prototype时遇到了麻烦。这是我的代码,它似乎没有工作。错误是RSV不是一个功能。我不确定如何将jQuery example翻译成Prototype。
function DomLoaded() {
var mainForm = document.forms[0];
try {
mainForm.RSV({
onCompleteHandler: OnComplete,
rules: ["required,txtEmailAddress,Please Enter an email addresss"]
});
}
catch (err) {
alert(err);
}
alert("dom:loaded");
};
function OnComplete()
{
alert("Complete.");
//Stops Form from submitting
return false;
}
答案 0 :(得分:0)
我自己修复了这段代码。这是答案:
function DomLoaded() {
try {
var myRSV = new RSV({
formID:"aspnetForm",
onCompleteHandler: OnComplete,
rules: ["required,txtEmailAddress,Please Enter an email addresss"]
});
}
catch (err) {
alert(err);
}
alert("dom:loaded");
};
function OnComplete()
{
alert("Complete.");
//Stops Form from submitting
return false;
}