Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET
i have textbox.when i enter value in textbox and goto another textbox using tab,this textbox disabled.for this i have use javascript in .js file like this..
function TotalFeesDesable()
<asp:TextBox ID="txt_totalfees" runat="server" onblur="TotalFeesDesable()"></asp:TextBox>
but it is not working.what is problem in my code?
Posted 25-Jan-13 8:13am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

First, you have to use proper control ID - check Control.ClientID property:[^]
Second, the correct DOM property is "disabled"; enabled is WebForm's property!
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It should read:
document.getElementById("ctl00_ContentPlaceHolder1_TabContainer1_TabPanel1_txt_totalfees").disabled = true;
<asp:TextBox ID="txt_totalfees" runat="server" onblur="javascript: return TotalFeesDesable()"></asp:TextBox>
Member 9511889 at 25-Jan-13 14:21pm
i have not this id is correct.
richcb at 25-Jan-13 14:28pm
Ok, I updated the solution. It should be what you are looking for.
Member 9511889 at 25-Jan-13 14:42pm
i have try this,but it is not working.
richcb at 25-Jan-13 14:44pm
Ok, let me ask you this. Are you sure you are causing the "onblur" event to be fired in order for your function to run?
Member 9511889 at 25-Jan-13 14:52pm
richcb at 25-Jan-13 15:25pm
Ok, check my updated solution again, I just got that to work.
Member 9511889 at 25-Jan-13 15:33pm
richcb at 25-Jan-13 15:37pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 547
1 Member 11120668 188
2 ChauhanAjay 180
3 Maciej Los 165
4 CHill60 135
0 Sergey Alexandrovich Kryukov 9,735
1 OriginalGriff 6,987
2 CPallini 5,835
3 George Jonsson 4,017
4 Gihan Liyanage 3,266

Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 25 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100