已选中复选框但未启用文本框 [英] Checkbox is already checked but textbox isnt enabled

查看:69
本文介绍了已选中复选框但未启用文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了CheckBox Checked启用文本框之类的功能,它工作正常但是在网格视图行中单击编辑按钮出现弹出窗口,其中所有行列都处于编辑模式但未选中此复选框且文本框不是启用



我用web方法获取网格行的所有行并使用了支柱

 [webmethod] $(' <%= chk.clientid%>')。prop(< span class =code-string>'  checked',obj.kmc)

这是检查复选框但是如何启用文本框

 $(' <%= txt.clientid')。val(obj.txt); 

如果选中复选框,这应该在行上启用



任何想法?



帮助??



我尝试过:



此函数正常处理文本框,但在gridview中的行编辑中,它不是


  function  changevalue(复选框){
document .getElementById(' & lt;%= inputKmcCode.ClientID%>')。style.display = checkbox.checked? ' block'' ;
}
& lt; / script

解决方案

' <%= chk.clientid%>')。prop(' < span class =code-string> checked',obj.kmc)

这是检查复选框但是如何启用文本框

 

' <%= txt.clientid')。val( obj.txt);

如果选中复选框,这应该在行上启用



任何想法?



帮助??



我尝试过:



这个函数正常处理文本框,但是在gridview的行编辑中它不是



  function  changevalue(复选框){
document .getElemen tById(' & lt;%= inputKmcCode.ClientID%>')。style.display = checkbox.checked? ' block'' ;
}
& lt; / script


当您调用复选框时,请在javascript函数内部尝试以下内容/>


  function  changevalue(复选框){
var chkbox =


I have Used A function like CheckBox Checked Enable Textbox, It is working fine but On clicking edit button in grid view row A pop up appears with all row columns in edit mode but this check box isn't checked and textbox is not enabled

I have used web method to get all the rows of grid row and used a prop

[webmethod] $('<%=chk.clientid%>').prop('checked', obj.kmc)

this is checking the checkbox but how to enable the text box

$('<%=txt.clientid').val(obj.txt);

this should enable on row only if check box checked

any ideas??

help ??

What I have tried:

this function working on textbox normally, but on row edit in gridview it isnt

function changevalue(checkbox) {              
            document.getElementById('&lt;%= inputKmcCode.ClientID%>').style.display = checkbox.checked ? 'block' : 'none';
        }       
    &lt;/script

解决方案

('<%=chk.clientid%>').prop('checked', obj.kmc)

this is checking the checkbox but how to enable the text box


('<%=txt.clientid').val(obj.txt);

this should enable on row only if check box checked

any ideas??

help ??

What I have tried:

this function working on textbox normally, but on row edit in gridview it isnt

function changevalue(checkbox) {              
            document.getElementById('&lt;%= inputKmcCode.ClientID%>').style.display = checkbox.checked ? 'block' : 'none';
        }       
    &lt;/script


Please try the below inside the javascript function when you call on change of checkbox

function changevalue(checkbox) {
var chkbox =


这篇关于已选中复选框但未启用文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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