jquery-php jQuery for no-refresh validation issues

Source: Internet
Author: User
Keywords PHP jquery
Phpjquery

Front-end to achieve: focus out of the input box, automatically to verify the card coupons, and the validation results no refresh back to the Prompt box

Now the problem is that the page code in the foreground

     $(document).ready(function(){       //DOM的onload事件处理函数          $("#button").click(function(){   //当按钮button被点击时的处理函数            postdata();                    //button被点击时执行postdata函数          });       });       function postdata(){            //提交数据函数          $.ajax({                     //调用jquery的ajax方法            type: "POST",              //设置ajax方法提交数据的形式            url: "checkCard.php",             //把数据提交到checkCard.php            data: "codeno="+$("#codeno").val(),  //交的数据            success: function(msg){     //提交成功后的回调,msg变量是checkCard.php输出的内容。              $('check').innerHTML+=msg;            //alert("数据提交成功");    //如果有必要,可以把msg变量的值显示到某个DIV元素中            }          });       

Front display area:

                                                                     兑换码

is not successful Ah, detailed visible
http://bbs.csdn.net/topics/391014234?page=1#post-399081723
Thank you

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.