• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 不提交而修改數據庫的方法.

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    很多注冊會員的地方,都有一個檢測會員帳號是否可用的功能,而且點擊按鈕后不用提交就可以完成檢測,下面就是它的實現方法 input name="nick" type="text" id="nick" span id="msg"/span input name="over" type="button" id="over" onClick="checknick();" val

    很多注冊會員的地方,都有一個檢測會員帳號是否可用的功能,而且點擊按鈕后不用提交就可以完成檢測,下面就是它的實現方法
    <input name="nick"  type="text" id="nick" >
    <span id="msg"></span>
    <input name="over"  type="button"  id="over" onClick="checknick();" value="檢測帳號">


    <iframe id="sendframe" name="sendframe" alt="不提交而修改數據庫的方法." src=http://www.3pcode.com/article/article_115/about:blank width="0" height="0" scrolling="no"></iframe>
    <form action="lookover.php" method="post" name="receive"  id="receive" target="sendframe">
      <input name="h_nick" type="hidden" id="h_nick" value="">
    </form>
    <script>
    function checknick()
    {
     document.getElementById("h_nick").value=document.getElementById("nick").value;
      document.getElementById("msg").innerText="正在檢測,請稍后...";
     document.receive.submit();
    }
    </scrip>
    工作原理:填入帳號后,點擊檢測按鈕,用js checknick()把表單receive提交,不過提交的目標是iframe,這樣就實現了不跳轉提交了,在lookover.php你就可以寫讀取數據庫或是修改數據的語句了.<span id="msg"></span>是用來取得返回信息的,比如checknick()函數中,就用document.getElementById("msg").innerText="正在檢測,請稍后...";來返回信息的,而在lookover.php要返回信息就要用parent.getElementById("msg").innerText="帳號可用"來返回.
    原理其實就跟異步聯動一樣.

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>