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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:55:58+00:00 2026-06-06T19:55:58+00:00

I got the array of disabled text boxes from the database. When I click

  • 0

I got the array of disabled text boxes from the database. When I click on edit button it should enable all the text boxes which are in array. But i could only enable the first text box. Here is the code.

code for edit button:

<input type="button" value="Edit" onclick="enable();" />

function enable()

function enable(){
document.getElementById("instance_name").disable = false;
document.getElementById("host_name").disable = false;
}

array:

$result=mysql_query("SELECT user_instance.instance_name, user_instance.host_name FROM
dba_account, user_instance WHERE dba_account.account_id = user_instance.account_id AND 
dba_account.account_id = '$accid'");

while($note = mysql_fetch_array($result))
{
<inut type='text' name='instance_name' id='instance_name' disabled='disabled' 
value='$note[instance_name]' size='25' />
<input type='text' name='host_name' id='host_name' disabled='disabled' 
value='$note[host_name]' size='25' />
}

I am getting all the disabled textboxes, but i can not anable them all. Appreciate your 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-06T19:56:00+00:00Added an answer on June 6, 2026 at 7:56 pm

    You’re giving the same ID to multiple elements. Each ID can only be unique to one element, so once javascript finds the first ID, it stops. I’d give it a class="instance_name" instead and then get the elements by class instead. You could do something like this:

    function enable(){
        Array.prototype.forEach.call( document.getElementsByClassName('instance_name'), 
                                      function(element){
                                          element.removeAttribute('disabled');
                                      });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got an array which I iterate over and try to create a variable.
I got an array which contains signed int data, i need to convert each
I got an array which contains some data like this: $arrs = Array(ABC_efg, @@zzAG,
i'm from poland so sorry for word mistakes. what's my problem? i've got array
I've got an array in perl which contains sorted non-contiguous values. For example: 1
I got array which has one,two,three,four,five. values.. in my array....says countListArray. I need to
I've got an array of files which looks like this: array ( 0 =>
I've got an array of sprites which I'm animating by incrementing their rotationX property.
I've got an array of objects, each of which has a property name ,
Say I've got this array: MyArray(0)=aaa MyArray(1)=bbb MyArray(2)=aaa Is there a .net function which

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.