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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:43:57+00:00 2026-06-03T10:43:57+00:00

I have multiple textareas in my HTML form followed by an edit link for

  • 0

I have multiple textareas in my HTML form followed by an edit link for each. When I click an
edit link, the corresponding textarea should be enabled. My code is as follows:

<script type="text/javascript">

    $(document).ready(function() {

        $(".edit").click(function(){
            $(this).attr("id").removeAttr("disabled");
        });

    });  

</script>

<textarea  id="txt1"  disabled="true"></textarea>
<a class="edit" id="txt1" >edit</a>

<textarea  id="txt2"  disabled="true"></textarea>
<a class="edit" id="txt2" >edit</a>

Why is the textarea not being enabled when the corresponding link is clicked?

  • 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-03T10:43:59+00:00Added an answer on June 3, 2026 at 10:43 am

    ids can only be used once in a page. you can’t have 2 elements (or more) having the same id.

    instead, do this:

    <form id="myform">
        <!-- group each in divs -->
        <div>
            <textarea disabled="true"></textarea>
            <a class="edit">edit</a>
        </div>
        <div>
            <textarea disabled="true"></textarea>
            <a class="edit">edit</a>
        </div>
    </form>
    <script>
        $(function(){
            $('#myform').on('click','.edit',function(){ 
                $(this)                       //when edit is clicked
                    .siblings('textarea')     //find it's pair textarea
                    .prop("disabled", false)  //and enable
                return false;
            });
        });
    </script>
    

    if you can’t use divs, then you can use prev('textarea') instead of siblings('textarea') to get the preceding textarea.

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

Sidebar

Related Questions

I have multiple forms on a page where each form will add individual item
In my form, I have a TextArea Box in which user can input multiple
If I have a textarea on an HTML page with multiple lines of text
I have a page that contains multiple textarea elements. These textareas and the IDs
I have multiple images inside one form. Depending on the image clicked a specific
I have a simple HTML Form that allows the user to enter some text
Hey guys I have a system where there is one form for each friend
I have a form I need to use on multiple pages: Controller $emailForm =
I have a html like below wherein there are multiple forms. I generate this
I have multiple table rows that has a set of radio buttons on each

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.