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 6704403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:17:05+00:00 2026-05-26T07:17:05+00:00

I have two Edit Text fields in my application,if i enter 50 in first

  • 0

I have two Edit Text fields in my application,if i enter 50 in first edit Text then in the second edit text i want to give permission to enter values less than 50 when the user enters a value in the second edit text, i want to give alert to the user if it is bigger than first edit text value.
How can i do this,means i need to check and show the alert when he enter the values i don’t want to show the alert when we press any other fields…
For example:in field 1 if user enter 35
in field2 he has enter value less than 35 only…

  • 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-26T07:17:05+00:00Added an answer on May 26, 2026 at 7:17 am

    initialize both edittext’s, lets called them myEditText1 and myEditText2

    in myEditText2 set a listener, there should be some kind of listener for when the text changes. Look for something like setOnTextChangedListener, here is how it would be used (this is pseudocode)

    myEditText2.setOnTextChangedListener(new OnTextChangedListener(){
    
        @Override
        public void OnTextChanged(View v)
        {
            int i = Integer.valueOf(myEditText1.getText().toString());
    
            int j = Integer.valueOf(myEditText2.getText().toString());
    
            if(j >= i)
            {
                  myEditText2.setText("");  //this automatically sets the editText2 field back to empty
            }
         }
    
       });
    

    this will only allow the user to enter numerical values lower than the value in the first edit text.

    But you need to make sure that the inputType: of both of your editText fields is set to numeric.

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

Sidebar

Related Questions

I have a view and it's composed of two tables. I want to edit
I have a Controller with two Edit methods (see below). When I submit the
I have two view controllers in a tabbar which can both edit data. Therefore,
EDIT: I also have access to ESXLT functions. I have two node sets of
If two users edit the same wiki topic, what methods have been used in
EDIT: I have fixed all but two warnings now, so thank you all for
Say I have two Activities in an Android application, EditPerson and EditEmployee . It
basically I have two input fields, name and username. The idea is that the
I have a search box where you can enter plain text. The keywords are
I am using jqgrid throughout my application. On two screens with inline edit, everything

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.