Click here to Skip to main content
15,903,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a text box with name "txtsendingAmount"

the null value i set from property is 0.00

when i run my page and enter the 12 in my text box without remove the 0.00

i want to show 12.00

but it is displaying
0.0012

how can i solve this error
Posted
Updated 5-Sep-12 4:53am
v2

1 solution

This is not an error. It is how a HTML element should behave. If you want that the textbox should be cleared on focus, then use this
HTML
<input type="text" value="0.00"  önfocus="this.value='';"></input>
 
Share this answer
 
v3
Comments
prince_rumeel 5-Sep-12 11:02am    
i am using this

<td width="30%" align="center" style="text-align:right">

<dx:ASPxTextBox ID="txtSendingAmount" runat="server" AutoPostBack="true"
TabIndex="3" Width="100%"
RightToLeft="True" Text="0.00" NullText="0.00" BackColor="LightGray">

</td>

i am using dev express control

please now help me how can i do that...
bbirajdar 5-Sep-12 11:05am    
try this


<td width="30%" align="center" style="text-align:right">

<dx:ASPxTextBox ID="txtSendingAmount" önfocus="this.value='';" runat="server" AutoPostBack="true"
TabIndex="3" Width="100%"
RightToLeft="True" Text="0.00" NullText="0.00" BackColor="LightGray">

</td>
prince_rumeel 5-Sep-12 11:16am    
no bro it is not working.
same problem
text remain 0.0011111
on focus when i type 33
it type like 0.0033
i want to show 33.00
plz guaid
bbirajdar 5-Sep-12 11:48am    
Does this dx:aspxtextbox has="OnClientClick" property? how do you add jaavscript to dx:aspxtextbox ?
bbirajdar 5-Sep-12 11:53am    
Use this javascript...http://www.javascriptkit.com/javatutors/formatnumber.shtml

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900