<script language="javascript">function save(){ document.form1.action="reg.php"; document.form1.submit();}function send(){ document.form1.action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"; document.form1.submit();}</script><form method="post" name="form1" id="form1" accept-charset="UTF-8"><div class="control-group"> <label class="control-label">姓名<span class="required-icon">*</span></label> <div class="controls"> <input name="user_name" type="text" class="input-xxlarge" placeholder="请输入姓名" myrequired="1"> </div></div> <div class="control-group"> <label class="control-label">手机<span class="required-icon">*</span></label> <div class="controls"> <input type="text" name="phone"> </div> </div><div class="control-group"> <label class="control-label">验证码<span class="required-icon">*</span></label> <div class="controls"> <input type="text" name="yzmk" value=""> <button type="button" class="btn" id="btn1" onclick="send();" value="btn1" style="margin-top:8px;">获取验证码</button></div> </div> <div class="control-group"> <label class="control-label"></label> <div class="controls"> <input name="submit" onclick="save();" type="button" id="submit" value="提交" > </div> </div></form>代码加粗部分是设置的js,但是提交以后,页面没有任何反应。 不知道是哪里出了问题。
1 回答
Hawavegee
TA贡献2条经验 获得超1个赞
"<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"
这里的双引号冲突啦
改成
'<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>'
添加回答
举报
0/150
提交
取消