TextBox Default Value Issue
Hi,
I have a Textbox in which I am showing a default value - "KGS".
When the User clicks the Textbox that Default value is gone & then user can Type his own value.
This TextBox had no validation.
Now My issue is that , I have to insert this value in database. This is a big form. SO, if the User doesn't Enter any value in the Textbox, then the default value i.e "KGS" goes into database. I don't want this.
What I want is, If the User enters nothing into the TextBox, then " " emty string should go to database & not the Value "KGS".
Following is the code -
<asp:TextBox ID="PD_weight" runat="server" Text="KGS" size="15" onFocus="if (value == 'KGS') {value=''}" onblur="if (value== '') {value='KGS'}" MaxLength="4"></asp:TextBox>
How this can be done?
Thank You.....!!
|