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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:11:34+00:00 2026-06-17T02:11:34+00:00

Possible Duplicate: use brackets in checkbox name when using php and javascript? I use

  • 0

Possible Duplicate:
use brackets in checkbox name when using php and javascript?

I use as name of input field in html code :

<input size="15" name="user[135][name]" value="" disabled=disabled>

then I want to work with it in javascript like this:

if(some_condition)  { document.myform.user[135][name].disabled=false; }

But that doesn’t work, because of the brackets in field name. Is there any way how to solve it without changing html code?

Experience: if I use name as user_135_name all works perfectly.

thankx for help.

Maros

  • 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-17T02:11:35+00:00Added an answer on June 17, 2026 at 2:11 am

    I’ll suggest add id to your input tag as follows

    <input size="15" id="user_name_135" name="user[135][name]" value="" disabled=disabled>
    

    Using simple Javascript

    if(some_condition) { document.getElementById("user_name_135").disabled=false; }
    

    Using jQuery

    if(some_condition){ $("#user_name_135").prop('disabled', false);}
    

    Also if there is only one statement followed by if you can omit {}

    if(some_condition) 
      document.getElementById("user_name_135").disabled=false; 
    

    Edited
    Please save following code as a html file and see it should work for you

    <!doctype html>
    <html>
    <head>
    <script>
    function some(){
      document.getElementById("user_name_135").disabled=false;
    }
    </script>
    </head>
    <body>
    <input size="15" id="user_name_135" name="user[135][name]" value="" disabled=disabled>
    <a href ="javascript:void(0)" onclick="some()">disbale input</a>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Use javascript variable in object name I am using CKeditor as a
Possible Duplicate: Use of ‘prototype’ vs. ‘this’ in Javascript? Advantages of using prototype, vs
Possible Duplicate: Can I use a generated variable name in PHP? Am stuck here!
Possible Duplicate: Use regular expressions to validate passwords I'm trying to code a php
Possible Duplicate: Use JavaScript to place cursor at end of text in text input
Possible Duplicate: Use of option helper in Play Framework 2.0 templates Normal html code:
Possible Duplicate: Why is it an error to use an empty set of brackets
Possible Duplicate: How to use include within a function? i have two file inc.php
Possible Duplicate: Scope with Brackets in C++ I'm dealing with v8 javascript engine, developing
Possible Duplicate: Use key’s value as key in key-value pair in Javascript As a

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.