根据下拉选择启用和禁用以及清除文本区域框 [英] Enable and Disable and clear textarea box based on Dropdown selection

查看:152
本文介绍了根据下拉选择启用和禁用以及清除文本区域框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试启用多行文本框,并根据待处理"的选择禁用并清除多行文本框.如果没有其他选择,我希望启用多行文本框.我正在尝试在SharePoint中使用JQuery来执行此操作 2013.到目前为止,我的代码在下面列出.但是,该警报根本无法收回任何价值.

I'm trying to Enable a multi-line textbox and disable and clear the multi-line text box based on the selection of Pending. If the selection is anything else, I want the multi-line text box to be enabled. I'm trying to do this using JQuery in SharePoint 2013. The code I have so far is listed below. However the alert isn't getting any value back at all.

$(document).ready(function(){

$(document).ready(function(){

var text = $(#id_of_Dropdown").val();

var text = $("#id_of_Dropdown").val();

警报(文本);

if(text ==待处理")

if(text == "Pending")

{

     $("input [value $ ='Save Changes']").attr('disabled',true);

      $("input[value$='Save Changes']").attr('disabled',true);

     $(" textarea [title $ = PM Comments']").attr('disabled',true);

      $("textarea[title$=PM Comments']").attr('disabled',true);

}

else

      

{

$("input [value $ ='Save Changes']").attr('disabled',false); $(" textarea [title $ = PM Comments']").attr('disabled',false);

$("input[value$='Save Changes']").attr('disabled',false); $("textarea[title$=PM Comments']").attr('disabled',false);

}

})

SharePoint工程师-迈克

SharePoint Engineer - Mike

推荐答案

嗨迈克,

这是给您的链接

https://stackoverflow.com/questions/16569260/enable-disable-form-elements-based-on-dropdown-list

https://stackoverflow.com/questions/16569260/enable-disable-form-elements-based-on-dropdown-list


这篇关于根据下拉选择启用和禁用以及清除文本区域框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆