Click here to Skip to main content
15,922,696 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i use java script validations for my form..it is working...But after fill all details properly then i want to give a success message and clear the text in txt boxes...in C# page it is okay like TextBox.Text=="";
but how it is possible in javascript?
Posted
Comments
Shivaram_i 28-Nov-14 0:04am    
Thank you so much...yesterday i wrote code like this $("#textBox1").val()="";
thats why it was not working...now its working...thank u once again

C#
$("input[type=text]").val('');//clear all the textboxes

$("#IdOfTextBox").val('');//clear textbox with the id used here

Its that simple.
 
Share this answer
 
v2
Fiddle[^]
Check the fiddle, you will get the answer.
Implementation for reference with Rohan's solution.
Hope this peice helps.
Thanks.
 
Share this answer
 
Comments
Shivaram_i 28-Nov-14 0:04am    
Thank you so much...yesterday i wrote code like this $("#textBox1").val()="";
thats why it was not working...now its working...thank u once again
[no name] 28-Nov-14 0:27am    
anytime my friend.
Keep coding..:)

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