传递参数,超级简单,急急急!!!!! 你总要输出的吧,在之前输出的页面 直接写在后面不就好了?要不呢 你这个values 从哪里来?不行就JS吧... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 values值是自己输入的,另外用JS怎么弄啊 document.form.startDate.valueform 等于你的form表单name <input type="text" name="startDate" value=""/><input name="cx" type="button" value="查询" onclick="javascript:window.location.href='index.php?new='+document.getElementsByName('startDate')[0].value" />但为什么要把简单的事情弄复杂呢?<form action='index.php'><input type="text" name="new" value=""/><input name="cx" type="submit" value="查询"/></form> 有jquery吗? 如果有jquery<input type="text" id="startDate" name="startDate" value=""/><input name="cx" type="button" value="查询" onclick="javascript:window.location.href='index.php?new=$('#startDate').val()" /> echo date('Y-m-d', strtotime('+1 day 2014-05-20'));2014-05-21 表示没有处理过于高端的js经验,jquery的方式可以尝试一下,不行就写一个js函数嘛,慢慢学习 写个function 处理较好。 <input type="text" name="startDate" value=""/> <input name="cx" type="button" value="查询" onclick="cx()" /> <script type="text/javascript"> function cx(){ window.location.href='index.php?new=' + document.getElementsByName('startDate')[0].value; } </script> 为什么么不用表单post提交呢~ 如果非要这样写的话 用js处理一下也可以弄- - 会是什么原因导致session_start启动慢。 公司要换网站了,要注意下什么? 奇怪的session丢失 php mysql如何定义筛选符合两个条件的数据 看看图片能能看 SmartTemplate的问题 null,false,true与NULL,FALSE,TRUE的区别 急:请问怎样设置网页在客户端浏览器Cache中的时间长短 我该怎么办呢? 请教:哪里有翻译过来的中文PHP.INI文件?像下面的那些我都不知道有什么作用? 关于php和js变量传值的问题 js中Array对象疑问
form 等于你的form表单name
<input name="cx" type="button" value="查询" onclick="javascript:window.location.href='index.php?new='+document.getElementsByName('startDate')[0].value" />但为什么要把简单的事情弄复杂呢?<form action='index.php'>
<input type="text" name="new" value=""/>
<input name="cx" type="submit" value="查询"/>
</form>
<input type="text" id="startDate" name="startDate" value=""/>
<input name="cx" type="button" value="查询" onclick="javascript:window.location.href='index.php?new=$('#startDate').val()" />
<input name="cx" type="button" value="查询" onclick="cx()" />
<script type="text/javascript">
function cx(){
window.location.href='index.php?new=' + document.getElementsByName('startDate')[0].value;
}
</script>