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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:52:31+00:00 2026-06-13T21:52:31+00:00

I have several input text element, I have button disable some input for disable

  • 0

I have several input text element,

I have button disable some input for disable some input element(s),

I have also button see values, for see all input values,

What I need:
for example I click on button disable some input, now some inputs are disabled right?

and now if click on button see values, I want see only that input values, which are not disabled.

I make almost all, but I dont know, how make this condition: if element already is disabled

please see demo
http://jsfiddle.net/WW8UF/4/

The body is:

<form>
      <ul id="my_ul">
             <li><input type="text" value="a" /></li>
             <li><input type="text"  value="s" /></li>
             <li><input type="text" value="d" /></li>
       </ul>
</form>

<div id="disable_btn">disable some input</div>
<div id="see_values">see values</div>

The js, using jQuery 1.8.2

$(document).ready( function () {  

        $("#disable_btn").on("click", function () {
            $("#my_ul li:eq(0) input").prop("disabled", true);
        });


        $("#see_values").on("click", function () {
            $("#my_ul li").each ( function () {
                if (1==1/*if this input is not disabled*/) {
                    alert ( $(this).find("input").val()  );
                }
            });
        });
});

​

  • 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-13T21:52:33+00:00Added an answer on June 13, 2026 at 9:52 pm

    No need to loop over every li, just get the inputs which are not disabled:

    $("#my_ul li input:not([disabled])").each ( function () { ... });
    

    Live example: http://jsfiddle.net/WW8UF/10/

    You could also use

    $("#my_ul li input:enabled").each ( function () { ... });
    

    Which is a bit cleaner. Live example: http://jsfiddle.net/WW8UF/11/

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

Sidebar

Related Questions

Hi I have several text input boxes, and i have a clear button, they
I have... a dynamic populated select box several input boxes a submit button form
I have a form that includes several input text fields and a list that's
When users click search input element, the search text inside the input will disappear
I have several INPUTs: <input type=text name=entry[1] value=aaa id=firstEntry /> <input type=text name=entry[2] value=bbb
At my web page, I have several text box controls (eg. Input type=text ...)
http://jsfiddle.net/EGjc9/ I have several <button> elements on a page, and I need to associate
I have a JavaScript overlay that consists of several input text search criteria. When
I have several text input fields in my page, and few radio buttons. Now
I have several datepickers tied to input fields. They are created in the usual

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.