Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  2] [ 1]  / answers: 1 / hits: 46418  / 12 Years ago, wed, june 6, 2012, 12:00:00

I have a simple input box where if the number is higher than 2, a popup message will appear.



Here is the code I am using, however I already have an onkeyup command on the input for something else, so I hope that won't be a problem



HTML:



<input id=jj_input23 type=text value='' onkeyup='changeTransform()' />


Javascript:



if(jj_input23 > 2) {
alert(Making the scale higher than 2 will make the preview too big);
document.getElementById('jj_input23').value();
}


After the aler message has been displayed, and the user has clicked Ok, I want the input text to reset. How can I do this?



Thanks in advance


More From » html

 Answers
11
if(jj_input23 > 2) {
alert(Making the scale higher than 2 will make the preview too big);
document.getElementById('jj_input23').value = ;
}


If you're using jQuery then you almost got it:



$('#jj_input23').val();

[#85100] Tuesday, June 5, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lara

Total Points: 462
Total Questions: 100
Total Answers: 102

Location: Jersey
Member since Mon, Jun 14, 2021
3 Years ago
lara questions
;