5
Answers

Clear textbox after click on reset button using angularjs

Ajay Shedge

Ajay Shedge

9y
3.3k
1
Hello,
 
I am creating on form using ASP.Net MVC and AngularJS. I have one textbox which is mandatory, one submit button and one clear button. If textbox remains blank and I clicked on submit button then textbox border color get red.But when I clicked on reset button I want to clear textbox button and remove border color. I have attached my code and snap.
 
Please give me solution
Answers (5)
0
Peter

Peter

NA 4 0 15y
That much I know.  My question is, why one PC converts 1 to string and gets "1" and the other does the same thing and gets "1.0"?
0
Manish Dwivedi

Manish Dwivedi

NA 8.3k 1.2m 15y
Hi

This is happening due to this res = "1.0" {string} while converting.

because you are using int.TryParse so u have to pass the values like 1,2,123,10 etc in the res parameter.

I think u got it.