Heim  >  Artikel  >  Backend-Entwicklung  >  原来是按enter可能提交按钮提交信息的,按刷新键也会自动提交

原来是按enter可能提交按钮提交信息的,按刷新键也会自动提交

WBOY
WBOYOriginal
2016-06-13 10:59:05738Durchsuche

原来是按enter或者提交按钮提交信息的,按刷新键也会自动提交

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><script language="javascript">//判断用户是否按回车键且转出的内容是否为空function inputKeyPress(){    if((event.keyCode==13)&&(document.all.chatWord.value!=null)&&(document.all.chatWord.value.length>0))    {        document.forms[0].submit();        document.all.chatWord.value='';        document.all.chatWord.focus();    }    }</script>
姓名:说:
//后边这个是提交信息的,并且我怎么写最后输出到chat.txt的除了“对”“说”别的文字全是乱码
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn