简体   繁体   English

检查没有注册的已注册电子邮件,并使用图像而非回显消息显示错误

[英]check already registered email without submit and display the error using an image not echo message

Please help me out... I'm creating a multistage sign up form, on my first step user is asked for email,password and confirm password... so when email input is typed and user enters the password, i need the script to be run in background for checking availability of email id, and if not available then message should be shown via image not echo message, so in short all these happens without submit ... and I'm using PHP please help me out... 请帮帮我...我正在创建一个多阶段注册表单,第一步是要求用户输入电子邮件,密码并确认密码...因此,当键入电子邮件输入并且用户输入密码时,我需要脚本要在后台运行以检查电子邮件ID的可用性,如果不可用,则应通过图像而不是回显消息来显示消息,因此总而言之,所有这些操作都无需提交...,而我使用的是PHP,请帮助我。 。

Thanks in advance 提前致谢

This is HTML: 这是HTML:

            <input type="password" id="signuppassword" name="signuppassword" class="register-input" placeholder="Password" />
            <input type="password" id="signup-cpassword" name="signup-cpassword"  class="register-input" placeholder="Confirm Password" />
            <input type="button" name="next" class="next action-button" id="first-next" value="" />

give ur email field a class or Id n use the folling function. 给我们的电子邮件字段一个类或ID,请使用以下功能。

$("#email").blur(function() 
    {
    var searchbox = $(this).val().trim();
    checkEmailExistance(searchbox);
    });//end on blur 

function checkEmailExistance(searchbox){ var dataString = 'searchword='+ searchbox.trim(); if(searchbox=='') { } else { $.ajax({ type: "POST", url: '<?php echo base_url()."index.php/register/email_validation"; ?>', data: dataString, cache: false, beforeSend: function() { }, success: function(dataString) { if(dataString=="0"){ $("#error").text("This is Unique Address"); $("#error").attr('isverified','1'); }else { $("#error").text("This email address is already present"); $("#error").attr('isverified','0'); } } });//end ajax };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM