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

  • SEARCH
  • Home
  • 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 6992091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:35:23+00:00 2026-05-27T19:35:23+00:00

I have a form on the login page with username and password text fields.

  • 0

I have a form on the login page with username and password text fields. Now wen the user registers for an account, I want to add him to the User model. And when he logs in I need to check whether the username/password combination is accurate to allow entry into the Sencha app.

I have no idea how to go about verifying the login/pass combo. Someone help !!! Here’s my code.

The Model :

App.models.Users = Ext.regModel('Expense',{

fields : [
    { name : 'id', type : 'integer'},
    { name : 'email', type : 'string'},
    { name : 'pass', type : 'string'}
],

validations : [
    { name : 'email', type : 'presence', message : 'cannot leave field blank'},
    { name : 'pass', type : 'presence', message : 'cannot leave field blank'}
],

proxy : {
    type : 'localstorage',
    id : 'user-creds'
}
});

Store :

App.stores.User = new Ext.data.Store ({
  model : 'Users',
  autoLoad : true,
  autoSave : true
});

The Form is a basic one, with an xtype “textfield” for email, and “passwordfield” for password.

How do I verify that the details entered in the form match those stored in the localstorage???

  • 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-05-27T19:35:24+00:00Added an answer on May 27, 2026 at 7:35 pm

    When you tap the button to login, you need to try and find the email address entered in the store.

    App.stores.User.findRecord('email', < the value entered on the form >) ;
    

    This method returns a record if a match is found. Once you have a record you can check that the password in the record matches the password entered on the form.

    Refer to Store in the Sencha Touch docs

    Update:

    Assuming you’re following the MVC pattern…

    You need:

    1. The textfields in a FormPanel
    2. A controller

    In the view, your login button dispatches to the controller:

        this.loginButton = new Ext.Button({
            text: 'Login',
            ui: 'action',
            handler: function() {
                Ext.dispatch({
                    controller: App.controllers.loginController,
                    action: 'login'
                });
            },
            scope: this
        });
    

    In your controller, the code retrieves the form values:

    'login': function (options) {
    
        var formDetails = App.views.loginView.getRecord();
    
        var store = Ext.StoreMgr.get('users');
        var record = store.findRecord('username', formDetails.get('username'), 0, false, true);
    
        if (record != null) {
    
          if (formDetails.get('password') == record.get('password')) {
            // valid login
          } else {
            // wrong password
          }          
    
        } else {
          // username doesn't exist
        }
    
     }
    

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login form that has Username and password as inputs from user
I have a simple login form, username and password. Basically, When a user is
I have a child page LoginContent.aspx which contains a login form. If the user
I have this situation: There are a login page with a login form (form
I have a login form, which needs to be re-directed to the main page
I have a login form for my website. This login form have two text
I have a usual login form consisting of two input fields, one for login,
I have a page with login form (on click, login form slides dowm) and
I have a login form that when submitted; redirects back to the login page.
I have a teacher login page below where the teacher enters in their username

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.