求大神,smarty异常

WBOY
Release: 2016-06-13 12:18:24
Original
929 people have browsed it

求大神,smarty错误

<br /><SCRIPT language=javascript><br />function CheckPost()<br />{<br />    if(myform.user.value="");<br />	{<br />     alert("请填写用户");<br />	 myform.user.focus();<br />	 return false;<br />	 }<br />	 if(myform.title.value.lengh<5){<br />	 alert("标题不能小于5字符");<br />	 myform.title.focus();<br />	 return false;<br />	 }<br />}<br /></SCRIPT>    <br /><br /><div class="form"><br /><form action="message.php" method="post" name="myform" onsubmit="return CheckPost();"><br />用户:<input type="text" size="10" name="user"/><br><br />标题:<input type="text" name="title" /><br/><br />内容:<textarea name="content"></textarea><br/><br /><br /><input type ="submit" name="submit" value="发布留言"/><br />
Copy after login


我想对表单验证,原来没有问题,但在htm加入这段javascript出现smarty错误,和smarty有什么关系啊?


------解决思路----------------------
js 代码被当做模板解释了吧?
------解决思路----------------------
请使用literal标签,包含js块
http://smarty.jz123.cn/language.function.literal.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template