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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:12:16+00:00 2026-06-12T07:12:16+00:00

Possible Duplicate: add “readonly” to <input > (jQuery) This is so weird, I hope

  • 0

Possible Duplicate:
add “readonly” to <input > (jQuery)

This is so weird, I hope there is a simple explanation.
I am working with Rails, but I don’t think that matters.

I add the readonly attribute to my project html element directly, I load the page and the input field behaves as readonly, like it should. After the page loads, the element looks like this:

<input class="span6" id="event_title" name="event[title]" readonly="readonly" size="30" type="text" value="test">

But I really want to add it through jquery. When I do that with:

$('#event_title').attr(readyonly", "readonly")

After the page loads, the element looks like this:

<input class="span6" id="event_title" name="event[title]" size="30" type="text" value="test" readyonly="readonly">

But the field is still editable and has no sign of being read only!
Please help….

  • 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-12T07:12:18+00:00Added an answer on June 12, 2026 at 7:12 am

    You’ve misspelled “readonly” in $('#event_title').attr(readyonly", "readonly") – you got “readyonly” as 1st param 🙂

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

Sidebar

Related Questions

Possible Duplicate: Why do some websites add “Slugs” to the end of URLs? This
Possible Duplicate: Weird “406 not acceptable” error I've been stuck on this ALL DAY!
Possible Duplicate: Can I add buttons to jQuery “alert”? When I click OK or
Possible Duplicate: How to “add existing frameworks” in Xcode 4? How do I add
Possible Duplicate: Causes of 'java.lang.NoSuchMethodError: main Exception in thread “main”' I'm hoping this is
Possible Duplicate: Undo “git add”? I made the mistake of running: git add .
Possible Duplicate: “new” keyword in property declaration Pardon me if this is C# 101,
Possible Duplicate: MSI Install Fails because “Another version of this product is already installed”
Possible Duplicate: In jquery: Use attr(“class”) value as a selector? I have fields with
Possible Duplicate: Any way to add HttpHandler programatically in .NET? Is there a way

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.