javascript alert help :)
Go to solution
Solved by ArjhanToteck,
On 5/14/2019 at 9:34 AM, Duckster said:my friend can help you. ill get him soon/later
I'm the friend Duckster was talking about. What you should do is assign a blank variable to the textbox where the characters are being typed. Then you can make another variable and assign the length of the first variable to the second variable. For example,
let text let characters
Then you should add a variable called var1 and then make a loop that sets the value of characters to the length of text as long as var1 = 0, and within it an if statement that tests the amount of characters and alerts the user if there are more than 750 characters.
var var1 = 0 while(chracters < 751){ characters = text.length if(characters === 750|| characters > 750){ overMax() } } function overMax(){ \\ add alert lines here. }
Depending on what you're file or application is, you can add the alert in the \\add alert lines here spot. This might work as the alert function;
function overMax(){ alert("You have 750 characters. You might want to save now to prevent losing some work in case of the program crashing.") }
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now