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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:31:47+00:00 2026-06-10T15:31:47+00:00

In languages such as Java or GUI frameworks such as Qt for C++, it

  • 0

In languages such as Java or GUI frameworks such as Qt for C++, it is possible to get a handle to some block of text (e.g. a label widget) the user cannot change, but which the program can modify based upon some condition being satisfied. I’d like to be able to do the same thing on an HTML web page from within some JavaScript code.

For example, consider a web page for entering user credentials. If the credentials are invalid, I’d like to display a message on the current web page without having to load a completely new page.

I’ve gotten it to work using an HTML text box or textarea, set to disabled, read only with some display style changes (via CSS). Changes induce some JavScript code to run which may result in changes to the value field of these text boxes or textareas. While this works okay, it just doesn’t seem right. Is there a more orthodox way of accomplishing this?

  • 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-10T15:31:48+00:00Added an answer on June 10, 2026 at 3:31 pm

    Sure. There are a few libraries to handle this.

    You may be asking for form validation. If so, try jQuery and jQuery’s validate extension library: demo

    Or you may be asking for a more generic-use observer pattern. If so, try one of the many MVVM/MVC libraries for JavaScript such as backbone.js or knockout.js (also ember, agility, angular, and spine): jsfiddle

    edit: also note that if your need is just standard form validation, you can accomplish it in jQuery validate without any code to speak of – just add properties directly on the HTML elements themselves indicating what the validation rules are. Unfortunately, HTML5 data attributes weren’t around when it was written, so you apply the validation rules as CSS classes.

    edit 2: also note that jQuery validate out-of-the-box supports remote validation, such as the credentials or username-already-exists scenario: demo or documentation

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

Sidebar

Related Questions

I've been wondering why do some languages, such as Java run on Both Linux
Some programming languages such as Java and C# include encryption packages in their standard
I moved one years ago from classic OO languages such like Java to JavaScript.
I've been doing some browsing on interactive consoles for programming languages such as: http://tryruby.org/levels/1/challenges/0
I know that some other languages, such as PHP , support a concept of
than higher level languages such as Java C#... is this argument valid? I'm new
Languages such as Java and PHP support reflection, which allows objects to provide metadata
I've worked with a few different languages such as Java, C#, and Objective-C. In
I'm not quite understanding why there are finalizers in languages such as java and
I have noticed in other languages such as Java that there are Objects such

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.