亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

一個form表單兩個按鈕提交,無反應。

一個form表單兩個按鈕提交,無反應。

滿江煙火3278656 2019-06-24 10:09:35
<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"]);??>'


查看完整回答
反對 回復 2019-06-26
  • 1 回答
  • 0 關注
  • 1307 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號