问题描述
|
我正在尝试为网站制作评论表单,允许用户在猎豹模板的html文件上留下他们的姓名,电子邮件和评论。我想使用此JQuery插件来验证输入:http://docs.jquery.com/Plugins/validation
我可以使用演示代码使该函数在其自己的文件中工作,但是当我尝试将其应用于cheetah模板时,Firebug给我以下错误:
$(\"#Feedbackform\").validate is not a function
[Break On This Error] $(\"#Feedbackform\").validate();
我将cheetah变量设置为\'@ \'以适应JQuery使用\'$ \',然后按如下所示调用函数:
#compiler-settings
cheetahVarStartToken=@
#end compiler-settings
<script type=\"text/javascript\">
$(document).ready(function(){
$(\"#Feedbackform\").validate();
});
</script>
#compiler-settings reset
这是表格的代码:
<form id=\"Feedbackform\" action=\"leaveFeedback.html\" method=\"GET\">
<table cellpadding=\"8\" style=\"width:600px;\"><tr>
<td valign=\"top\" align=\"right\" >Name</td>
<td><input type=\"text\" id=\"fname\" name=\"name\" class=\"required\" minlength=\"2\" size=\"30\"></td></tr>
<tr><td valign=\"top\" align=\"right\" >Email</td>
<td><input type=\"text\" id=\"femail\" name=\"email\" class=\"required email\" size=\"30\"></td></tr>
<tr><td valign=\"top\" align=\"right\" style=\"width:100px\" >Comment</td><td>
<textarea name=\"Feedback\" id=\"fcomment\" class=\"required\" rows=\"10\" style=\"width:400px;\"></textarea>
<input class=\"submit\" type=\"submit\" name=\"submit\" value=\"Submit\"></td></tr>
</table>
</form>
任何建议或帮助将不胜感激。谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)