Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7922461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:57:43+00:00 2026-06-03T16:57:43+00:00

1.) I have a code script to check if the user has entered a

  • 0

1.) I have a code script to check if the user has entered a correct email format;

if (val.search("[a-z]+@[a-z]+[.][a-z]+") == -1)
                          Ext.Msg.alert("Error", "Invalid e-mail address!!"); 

This code is incorrect as the username and domain name could take in Numbers as well. So how do i correct the code ?

2.) In the view, i have 2 fields; password and retype password. How do i check if these 2 are equal ?

{
                          xtype:'textfield',
                          name:'password',
                          label:'Password'
                          },
                          {
                          xtype:'textfield',
                          name:'rpassword',
                          label:'retype password'
                          }
                          ]
                   },
                   {
                   xtype:'button',
                   id:'pwdButton',
                   text:'register',
                   ui:'confirm'
}

3.) Is there a possibility to do Ajaxified error checking, meaning to pop up error messages as the user goes to the next field (without having to wait till he clicks the Register button)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:57:45+00:00Added an answer on June 3, 2026 at 4:57 pm
    1. For performing the email validation, you can check out my below code. It also works out, if the username and domain name have Numbers.

      {
        xtype: 'emailfield',
        name: 'email',
        label: 'Email',
        id: 'emailId',
        placeHolder: 'google@gmail.com',
        required: true,
        listeners: {
          blur: function(thisTxt, eventObj) {
                  var emailValue = thisTxt.getValue();
                  var atpos = emailValue.indexOf("@");
                  var dotpos = emailValue.lastIndexOf(".");
                  if (atpos<1 || dotpos<atpos+2 || dotpos+2>= emailValue.length) {
                      Ext.Msg.alert("Not a valid e-mail address");
                  } else {
                      Ext.Msg.alert('Valid','You entered a valid email address');
                  }
          }
         }
       }
      
    2. For checking if user retyped the same password correctly, you can check out the below code,’

       {
          xtype:'textfield',
          name:'password',
          id: 'pswd1',
          label:'Password'
       },
       {
          xtype:'textfield',
          name:'rpassword',
          id: 'pswd2',
          label:'retype password',
          listeners : {
              blur : function() {
                 var prevPassword = Ext.getCmp('pswd1').getValue();
                 var rePassword = Ext.getCmp('pswd2').getValue();
                 if(prevPassword == rePassword) {
                      Ext.Msg.alert('Success','Passwords match');
                 } else {
                      Ext.Msg.alert('Failed','Passwords entered do not match');
                      Ext.getCmp('pswd2').focus();
                 }
             }
         }
       }
      
    3. meaning to pop up error messages as the user goes to the next field (without having to wait till he clicks the Register button)

    You need to listen for the blur event of any form field. So, when that p’cular field looses focus, it will call the blur() function and then you can perform the validation w/o having to hit the Register button.

    listeners : {
         blur : function() {
             // Validation code goes here .
             ....
             ....
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple code that speaks for itself. <script language='javascript"> function check() {}
I have java script code to set some of the properties of ajax controls.
I have a script code in vb.net environment which is calling file from path
I have code on javascript: <script>var index=0</script> How can i pass it to htmlhelper
I have developed code on a m-file script in Matlab that communicates with a
I have the following code in action script 3: async.addResponder(new Responder(result, defaultFaultHandler)); result is
I have followin code in one legacy script: while (<FPTR>) # While still input
I have the following code validation php script: if(empty($_POST['captcha_code'])) { $error = 1; $code[3]
I have this code: <script type=text/javascript> var maxLength=10; function charLimit(el) { if (el.value.length >
I have this code in userpage.php: <script langauge=JavaScript><!-- function newWindow(fileName,windowName) { msgWindow=window.open(fileName,windowName); } //--></script>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.