Click here to Skip to main content
15,917,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hey guys,,

I have a textbox(State) with emptymessage with "MA".My page contains more than 100 textboxes.I am using server side validation on my page.Now problem is what

When textbox(State) is empty then MA is shown by default.now when MA is shown and User click on save then record is not saved.It shows requirefield for State.

So i want to save record if there is emptymessage in textbox.

Please help me
Thank and regards
Rahul
Posted

Empty message is shown when text box is hmmm - empty!?
It's not a replacement for default value, but only a placeholder in case there is no value.
 
Share this answer
 
Comments
Rahul_Pandit 27-Jan-14 7:59am    
hey there is a problem when textbox has emptymessage ma then requirefiled runs but i want to save it because MA is a state.

Can u put some relevant code for it.
Kornfeld Eliyahu Peter 27-Jan-14 8:20am    
Do you mean to put MA as default value in case user didn't choose anything other?
RadTextBox does not have a solution for that - you may insert the default value using your validator...
Rahul_Pandit 27-Jan-14 8:34am    
yeah if emptymessage is shown then i want to set default value using validator.u got it but can u put some code for me to understand how to do it.
Kornfeld Eliyahu Peter 27-Jan-14 8:58am    
I'm afraid I have no time to do so - but consider this: write some custom validator (based of RequiredFieldValidator) where if value is empty you update it to empty message - if presents...
I resolved it using javascript onblur n onfocus fuction and setting value on the basis of condition.
 
Share this answer
 

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