javascript - Oracle apex,在每个字段必须为空的情况下禁用提交页面按钮,如何?

标签 javascript jquery oracle oracle-apex oracle-apex-5

如何为按钮指定 ID?您将如何影响按钮的属性来禁用和启用它,具体取决于字段是否为空。我不想使用动态 Action 。我在想 JavaScript。任何帮助都会有所帮助。谢谢。

最佳答案

这就是你给出id的方式到 button :

<input type="button" id="your-id" value="My Button">

假设我们正在讨论的领域是

<input type="text" id="another-id">

这是启用/禁用 button 的方法当您在 input 中输入一些文本时(您需要将 Javascript 代码编写为 <script> 标记的内部文本):

<script type="text/javascript">
    $(function() { //Load event
        $("#another-id").change(function() { //change event
            if ($(this).val().length > 0) { //It is not empty
                $("#your-id").removeAttr("disabled");
            } else { //It is empty
                $("#your-id").attr("disabled", true);
            }
        });
    });
</script>

关于javascript - Oracle apex,在每个字段必须为空的情况下禁用提交页面按钮,如何?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42536203/

相关文章:

javascript - 如何检测选择标签(Angular 2)上对 ngModel 的更改?

javascript - 使用 NaN 时允许输入小数点

jquery - 如何防止我的 jquery 模式滚动到窗口的顶部?

c - 在 Pro*C 中处理 float

javascript - 如何将 html 标签 id 转换为 php 字符串

javascript - 需要在仅移动元素中平滑滚动

javascript - Jquery 如何在单击列表项时选中单选按钮?

javascript - 以编程方式更改输入字段中的值执行某些任务

mysql - 创建表空间 "error in creating database file, access denied (OS 5)"

oracle - 将字符串转换为字符的函数