Input prompt

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Benson-Manica

    Input prompt

    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)cybers pace.org |
  • Lee

    #2
    Re: Input prompt

    Christopher Benson-Manica said:[color=blue]
    >
    >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"))?[/color]

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

    Comment

    Working...