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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:18:50+00:00 2026-06-09T17:18:50+00:00

I am developing some web interfae, I would like to convert some INPUT elements

  • 0

I am developing some web interfae, I would like to convert some INPUT elements in non-editable/non-changable but still showing the inputed value. How an be this done?

In Chrome at least, disabled attribute makes the inputed value disappear (unmarked checkboxes, non-filled radio buttons) but readonly label allows user to keep changing values. Why? Is this a Chrome thing? Whats the best wa for simply not-allowing interaction but mantaining and showing the preselected value so far?

EDIT: I am using jQuery´s

$('#deForm :input').attr('readonly',true);

and

$('#deForm :input').attr('disabled',true);

for this test. Both seem to be handled ok, since GUI shadows input elements. But none of them shows my expected functionality

EDIT2: I also tried to put ‘readonly’ and ‘disabled’ as the second argument in jQuery instead of ‘true’ but it has same effect

EDIT3: I also tried to add to readonly.

 $('#deForm :input').attr('readonly',true);
 $('#deForm :input').keypress(function(event){
      event.preventDefault();
 });

but behavior is the same as in plain readonly

  • 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-09T17:18:51+00:00Added an answer on June 9, 2026 at 5:18 pm

    This is the default behavior of the readonly and disabled properties. You can use the preventDefault method of the event object.

    <input type='text' value='something'/>
    

    $('input[type=text]').keypress(function(event){
        if (something is true) {
           event.preventDefault()
           // or return false
        } else {
           //
        }
    }) 
    

    http://jsfiddle.net/2fKjX/

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

Sidebar

Related Questions

I'm developing a mobile oriented website using asp.net. This website will consume some web
I'm developing a web application that shows some controls and descriptions dynamically (I don't
I'm developing a web application myself to follow some rssfeeds. My purpose is just
I am developing a web application. For some reasons, I need to use external
I'm developing a firefox plugin and i fetch web pages to do some analysis
I am developing an ASP.Net MVC 3 Web application and I am having some
First, some background: I'm developing a web application using Python. All of my (text)
I'm developing an app (an API) in python and I would like to offer
I am developing a web-based user interface that plots some data from a database
I don't have a lot of experience developing web-based data entry software, but comparative

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.