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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:51:08+00:00 2026-06-04T18:51:08+00:00

In my form, I hava a CeckBox and its required to be checked to

  • 0

In my form, I hava a CeckBox and its required to be checked to submit. If it’s unchecked, I call setError() to warn the user. But, once the error is displayed, it don’t disappears, no matter the checkbox is checked or not.
Other bug is that if the error text is much long, it appears incomplete. In landscape mode, it appears complete.

checkbox xml:

<CheckBox 
        android:id="@+id/reg_terms"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Li e concordo com os Termos de Uso."
        android:focusableInTouchMode="true"
        android:focusable="true"
        android:textColor="#000000"
        android:checked="false"
        />

Validation (inside submitButtons’s onClick):

if(!reg_terms.isChecked()){
  reg_terms.setError("É preciso aceitar os Termos de Uso");
  validation = false;
  }

There isn’t any “addOnFocusChangedListener” methot I could use to “dismiss” the error if user checks the box? And how could I avoid the error text to appears incomplete?

Viele danke für alle Hilfe. 😀

  • 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-04T18:51:09+00:00Added an answer on June 4, 2026 at 6:51 pm

    As far as clearing the error, you can add an OnCheckedChangeListener like this:

    reg_terms.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if ( isChecked ) {
                reg_terms.setError(null);
            } else {
                reg_terms.setError("É preciso aceitar os Termos de Uso");
            }
        }
    });
    

    Personally, I would extract the string into your R.strings as well and reference it in the XML and the code.

    For the text wrapping, try adding reg_terms.setMaxLines(2) to your code to allow text to fill up to 2 lines. I’m not sure if this will work, but it’s worth a try.

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

Sidebar

Related Questions

I hava a form (form_remote_tag) that updates a comments section. The form is in
I am trying to upload an image to the server. I hava a form
- form_tag sign_in_users_path do - if @user.errors.any? %div#error_explanation %h2= pluralize(@user.errors.count, error) %ul - @user.errors.full_messages
My form has issues with latin characters (portuguese). If the user submitted his info
Form -> Submit Takes you to view of the new entry. How can I
The form here works fine in the browser, but for some reason I cannot
Form and table are on the same page. When user adds form details and
$(form).submit(function () { var english = $(input #rawr).val() $(h1 em).append( + english + );
My form keeps redirecting back to the main contact page... so its not processing
I am Using jquery validate() plugin . i hava a combobox in form that

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.