Bug Tracker

Opened 13 years ago

Closed 13 years ago

#1085 closed bug (worksforme)

Cannot undisable disabled hidden fields

Reported by: aichinge Owned by:
Priority: major Milestone: 1.1.3
Component: core Version: 1.1.2
Keywords: Cc:
Blocked by: Blocking:

Description

Hi, I use 1.1.2 version and I try this ".EnFormPassive//input[@type='hidden']" or ".EnFormPassive//:hidden" selector to enable and disable hidden fields. Ex.:

disable: $(".EnFormPassive//input[@type='hidden']").attr("disabled", "true");

enable: $(".EnFormPassive//input[@type='hidden']").attr("disabled", "false"); or $(".EnFormPassive//input[@type='hidden']").removeAttr("disabled");

HTML for this is that there are about 5 DIVs with EnFormPassive class, they contain some fieldsets, or fieldsets in fieldset and in this fieldsets are hidden fields.

It disable it correctly, but jQuery doesn't find any element to enable! They are accessible only throught their IDs, but it is not so dynamic.

Change History (2)

comment:1 Changed 13 years ago by malsup

I could not duplicate this problem in either FF or IE. I used the following script and the hidden input was always found:

<html>
<head>
<script type="text/javascript" src="../rel/jquery-1.1.2.js"></script>
<script type="text/javascript">
$(function() {
    $('#count').click(function() {
        var jq = $(".EnFormPassive//input[@type='hidden']");
        alert(jq.length);
    });
    $('#enable').click(function() {
        var jq = $(".EnFormPassive//input[@type='hidden']");
        jq.removeAttr("disabled");
        alert('disabled='+jq[0].disabled);
    });
    $('#disable').click(function() {
        var jq = $(".EnFormPassive//input[@type='hidden']");
        jq.attr("disabled", "true");
        alert('disabled='+jq[0].disabled);
    });
});
</script>
</head>
<body>
<form class="EnFormPassive">
    <fieldset>
        <input type="hidden" value="mike" />
        <button id="count">Count Hidden Inputs</button>
        <button id="disable">Disable Hidden Input</button>
        <button id="enable">Enable Hidden Input</button>
    </fieldset>
</form>
</body>
</html>   

comment:2 Changed 13 years ago by john

need: PatchReview
Resolution: worksforme
Status: newclosed

Seems to work for Mike, closing.

Note: See TracTickets for help on using tickets.