Help with JAVA Scripts
-
I have a grid view whose rows contain, a linkbutton and a textbox. The textbox is initially not visible. If any linkbutton is clicked, then the text-box in the corresponding row has to be made visible. I am able to do this with server-side event. But its introducing some delay which is very irritating to the user. If a client-side script can do this, it will boost the site performance. How this can be achieved with Java Scripts ?
Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)
-
I have a grid view whose rows contain, a linkbutton and a textbox. The textbox is initially not visible. If any linkbutton is clicked, then the text-box in the corresponding row has to be made visible. I am able to do this with server-side event. But its introducing some delay which is very irritating to the user. If a client-side script can do this, it will boost the site performance. How this can be achieved with Java Scripts ?
Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)
Instead of making the textbox invisible, set the CSS display to none. You can do this like TextBoxName.Style.Add("display", "none"); Call a javascript function on the OnClientClick of the linkbutton and set the display as visible of textbox here.
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Instead of making the textbox invisible, set the CSS display to none. You can do this like TextBoxName.Style.Add("display", "none"); Call a javascript function on the OnClientClick of the linkbutton and set the display as visible of textbox here.
Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
i wrote it like this ...
<asp:LinkButton ID="lbkReply" runat="server" Text="Reply" OnClientClick="txtReply.Style.Add('display','none')" />
But, its not making the text box txtReply invisible .... :(
Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)
-
i wrote it like this ...
<asp:LinkButton ID="lbkReply" runat="server" Text="Reply" OnClientClick="txtReply.Style.Add('display','none')" />
But, its not making the text box txtReply invisible .... :(
Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)
txtReply is the name on the server, it will have a mangled name on the client. Use txtReply.ClientID in server side code to emit the ID you need to use on the client. Even then, I thought you need to use document.getElementById("txtReply").Style.Add...
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp