Question

I have a user information form in which I have alloy aui button in my form.

<aui:form action="<%=saveUser%>" method="post"  id="saveUserForm" name="saveUserForm" onSubmit='<%= "event.preventDefault(); " + renderResponse.getNamespace() + "saveUserForm();" %>' >

<aui:fieldset >
    <aui:input inputCssClass="aui-field-required" id='empType' name="empType" label="Emp Type (Required)" value='<%= (type!=null)?type.getEmpType():"" %>' />
    <aui:select label="state" name="regionsIDS" />
</aui:fieldset>

<aui:fieldset>
            <aui:input type="checkbox" 
                    id="novalue1" 
                    name="novalue" onClick="myFunction()"
                    checked="<%= multipleAdmin%>" >
                </aui:input> 
            </aui:fieldset>

<aui:button-row>
                <aui:button type="submit" value="Save and Continue" cssClass="btn-xl btn-blue" disabled="true"/>
            </aui:button-row>

I have set it disable with property disabled="true". Now I want to enable this button if my any input text box or checkbox value gets changed.

So how can I do enable my aui button if any above input text or dropdown or checkbox value gets changed?

Était-ce utile?

La solution

onchange of dropwdonw or textfiled change event do following.

var btn = "get your button from its id here";
    btn.set('disabled', false);
    btn.ancestor('.aui-button').removeClass('aui-button-disabled');

Let try this.i havent tried this but hope it helps you just put id property in <aui:button > and get btn from its id as explained above

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top