-6ren">
gpt4 book ai didi

javascript - 如果任何 aui 表单字段值发生更改,则启用 aui 按钮

转载 作者:行者123 更新时间:2023-11-30 17:59:43 25 4
gpt4 key购买 nike

我有一个用户信息表单,其中我的表单中有合金 au 按钮。

<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>

我已使用属性 disabled="true"将其设置为禁用。现在,如果我的任何输入文本框或复选框值发生更改,我想启用此按钮。

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

最佳答案

onchange of dropwdonw 或 textfiled change 事件执行以下操作。

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

让我们试试这个。我没试过这个,但希望它能帮助你只需将 id 属性放入 <aui:button >并如上所述从其 id 中获取 btn

关于javascript - 如果任何 aui 表单字段值发生更改,则启用 aui 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17313474/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com