By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,253 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,253 IT Pros & Developers. It's quick & easy.

Input prompt

P: n/a
Is there a way to limit the amount of text a user may type into an input
dialog box (like window.prompt("Enter a 10 character value"))?

--
Christopher Benson-Manica | Jumonji giri, for honour.
ataru(at)cyberspace.org |
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Lee
Christopher Benson-Manica said:

Is there a way to limit the amount of text a user may type into an input
dialog box (like window.prompt("Enter a 10 character value"))?


<html>
<body>
<script type="text/javascript">
var pword="";
var msg="Please enter a 10 character value";
var expletive=", dammit!";
while(pword.length!=10){
pword=prompt(msg);
msg+=expletive;
expletive="";
}
document.write("Thank you for entering \""+pword+"\"");
</script>
</body>
</html>

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.