Last post Sep 29, 2009 06:51 PM by vvettiya
Jan 09, 2009 05:57 AM|asp_crazy_guy|LINK
I have a masked edit control bounded to a currency textbox, I want to select all the text on click event of the textbox. I tried the following on form load event
But its not working for some reason, any clue guys ?
Jan 09, 2009 08:09 AM|mudassarkhan|LINK
ignore the warning of VS this works
Jan 09, 2009 08:12 AM|Ram Reddy Mekha|LINK
You can do it in the client side it self.
Just try this...
otherwise if you want to do it in the code behind
this in your page load event.
Jan 09, 2009 08:26 AM|mooncoder|LINK
Jan 09, 2009 08:28 AM|nitindhiman|LINK
try this script...
).focus(); document.getElementById(Id).select();}</script>Input TextBox:<br><asp:TextBox id="txtfld" runat="Server" onClick="SelectAll('txtfld');"/>
Jan 13, 2009 05:01 AM|asp_crazy_guy|LINK
Thanks for the replies guys. The above solutions dont work at all with the textbox bound to masked edit, they do work perfect with the simple textbox. My requirement is to select all text on click which is bound to a masked edit control.
<asp:TextBox id="txtTrtLimit" runat="server" ></asp:TextBox> <cc1:MaskedEditExtender id="MaskedEditExtender4" runat="server" TargetControlID="txtTrtLimit" MaskType="Number" Mask="999,999,999,999,999" AutoComplete="False" InputDirection="RightToLeft"
Any clue guys ?
Jan 13, 2009 05:11 AM|mudassarkhan|LINK
what issues are you facing it that??
Jan 13, 2009 05:16 AM|asp_crazy_guy|LINK
It wont select all the text inside the textbox when its bound to the masked edit with the above solutions. I want to actually let the users have ease in editing the values inside the textbox.
Jan 13, 2009 05:33 AM|mudassarkhan|LINK
Did you try my code And did it give you an error??
Remeber one thing when the page is rendered there are no asp controls only html controls are there.
Jan 13, 2009 06:25 AM|asp_crazy_guy|LINK
Hi Mudassir I tried your code its not working with the textbox bind to masked edit.
Any clues ?
Sep 25, 2009 07:27 PM|vvettiya|LINK
Sep 26, 2009 11:20 AM|nitindhiman|LINK
I exectly don't know ur problm, but as u r saying tht function is calling but u r not getting the desired result, just view the source of the page and match the client id of the textbox with the id of tht in the called function.
Hope it helps...
n aaj saturday hai, kaam karne ka din nahi hai...
Sep 28, 2009 08:48 AM|asp_crazy_guy|LINK
Hi I got it working fine for the date extender. The real problem was with the currency mask. It did not worked properly. What happened was that if the user used tab to switch between the boxes it worked fine, even on mouse click if you click on the end of
the textbox where the currency figure ends it worked but if the user clicked in between the numbers it just wont select all the text.
It just puts the cursor in between the currency. We couldnt work it out as time was short and used javascrip insetad of masked edit for currency. Still I am awaiting for a solution in this matter.
Best regards, Mike.
Sep 29, 2009 06:20 PM|vvettiya|LINK
How did you get working for the date extender? I am still having issues with the
MaskedEditExtender1. I have a "date mask" as __/__/____.
Somehow the date mask intereferes with the Select() function. The onFocus() event fires because I tested it with an alert message. It's just that the "select();" to select the text does not work.
Sep 29, 2009 06:51 PM|vvettiya|LINK
Here is my problem:
I am using the MaskedEditExtender1 for a text field used for DATE INPUT. I have a "date mask" as __/__/____. I need to highlight the value in the text field on Focus.