Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Guest UserRank #816 · 2.8K reputationPosted Oct 27, 2014, 1:10 AM EDT
document.getElementById("Rftxtfrom2").disabled = true;
Abhijeet SinghRank #415 · 6K reputationPosted Mar 28, 2015, 11:31 AM EDT
http://www.techtamasha.com/disablereadonly-and-enable-textbox-using-javascript/34
Joginder BangerRank #360 · 7K reputationPosted Mar 28, 2015, 12:22 PM EDT
user have no idea what is enter in textbox, suppose user enter the some white space your condition is false. I think this a not a good idea for validate the value and one more thing i can't understand what you want disabled or hide the textbox and another control. checked like this
Remove the white space in jquery, try this code
$.trim(control id)
Enable or Disabled control
if($('#txtfrom2').val()!='null'||$('#txtform2').val()!='')
{
ValidatorEnable('<%=yourControlName.ClientID %>', false);
}
else
{
ValidatorEnable('<%=yourControlName.ClientID %>', false);}
Hide and unhide control in jquery
if($.trim($('#txtfrom2').val())!='null'||$.trim($('#txtform2').val())!='')
{
$('#controlId').hide();
}
else
{
$('#controlId').show();
}
*jsb