【问题标题】:How to disable/enable the textbox in some div on selecting the particular option value of dojo filtering select..?如何在选择dojo过滤选择的特定选项值时禁用/启用某些div中的文本框..?
【发布时间】:2013-08-02 08:09:50
【问题描述】:

如何在从 dojo 的过滤选择中选择特定值时启用/禁用特定文本框..?例如,如果我选择更新鲜,则该文本框应禁用。

这是我的代码: 这是我的道场选择 div

<div class="input select exp">
    <label>Total years of Experience</label>
    <select dojoType="dijit.form.FilteringSelect" name="sname" autocomplete="false"  id="yoe">
        <option value="Fresher">Fresher</option>
        <option value="1+">One year</option>
        <option value="2+">Two year</option>
        <option value="3+">Three Year</option>
    </select>
    <span class="error">required</span>
</div>

在这个 div 中我需要禁用或隐藏这个文本框

<div class="input text">
    <label>Current Designation</label>
    <input type="text" value=""  dojoType="dijit.form.ValidationTextBox" trim="true" id="sdd"/>
    <span class="error">required</span>
</div>

请回复请帮助,任何帮助将不胜感激。

【问题讨论】:

    标签: html dojo


    【解决方案1】:

    使用 HTML:

    <SELECT onChange="adjust(this.value)>"
    
    ...
    
    <DIV class="input text" id="inputtext">
    

    和 JavaScript:

    function adjust(value) {
        if(value == ""Fresher) {
            document.getElementById('inputtext').style.display = 'none';
            ...
        } else if ...
    
    }
    

    【讨论】:

    • 哦,非常感谢 profMax 你节省了很多时间谢谢它很酷。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-22
    • 2012-08-28
    • 1970-01-01
    • 1970-01-01
    • 2015-05-12
    • 2023-03-23
    • 2018-02-11
    相关资源
    最近更新 更多