i have two TextBoxes with the class store on one and banner on another. i managed to get a watermark without using the value="" but i was wondering is there a way to have an on submit action if textbox value is not an int to make value of the textbox an empty string? im still really new to all this. thx in advance. btw i am trying to put this on an mvc4 page.
Asked
Active
Viewed 133 times
-1
-
is there a way to do it with jquery. – Ethan Moses Sep 04 '13 at 20:54
-
i dont know about that. – Sep 04 '13 at 20:56
1 Answers
0
I'm assuming .net
at the very least due to the mvc4
comment.
Are you looking to interpret non-ints to be the empty string?
string i = "123";
string j = "ft1b";
int temp;
i = int.TryParse(i, out temp) ? i : "";
if you need to do this in javascript, you can use the isNaN() function instead of TryParse

Community
- 1
- 1

Sam I am says Reinstate Monica
- 30,851
- 12
- 72
- 100
-
thank you im completely new to coding and didnt know where to start. – Ethan Moses Sep 04 '13 at 21:04