function url js php
比如
<form action="<?php echo base_url('heli/add'); ?>" method="GET" onsubmit="return add();"> <input name="call" name="call" type="text" value="<?php echo $this->input->get('call');?>" /> <td><input type="submit" value="添加" /></td></form><script type="text/javascript"> function add(){ var call= $("#call").attr("value"); if(call== ""){ alert("NO"); return false; } return true; }</script>
<form action="<?php echo base_url('heli/add'); ?>" method="GET" onsubmit="return add();"> <input name="call" name="call" type="text" value="<?php echo $this->input->get('call');?>" /> <td><input type="submit" value="添加" /></td></form><script type="text/javascript"> function add(){ var call= $("#call").attr("value"); if(call== ""){ alert("NO"); return false; } return true; }</script>
<form action="test3.php" method="GET" onsubmit="return add();"> <input name="call" id="call" type="text" value=""/> <td><input type="submit" value="添加" /></td></form> <script type="text/javascript"> function add(){ var call= document.getElementById('call').value; if(call== ""){ alert("NO"); return false; } return true; }</script>好人做到底吧,帮你调试一下。你没有检查而直接提交是因为JS有错误,有可能是因为没有引入jquery的原因。
<form action="test3.php" method="GET" onsubmit="return add();"> <input name="call" id="call" type="text" value=""/> <td><input type="submit" value="添加" /></td></form> <script type="text/javascript"> function add(){ var call= document.getElementById('call').value; if(call== ""){ alert("NO"); return false; } return true; }</script>好人做到底吧,帮你调试一下。你没有检查而直接提交是因为JS有错误,有可能是因为没有引入jquery的原因。你input里面有两个name属性哦,应该是一个id一个name!你改下看下能不能行。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号