how to set char limit in prompt box using javascript?

Recommended Answers

What do you mean by this, in more details?

Jump to Post

If you're talking about a js popup, then I don't think it's possible. However modal dialogs like jQueryUI popups, which may serve a similar purpose for you can be controlled as you can use a <input maxlength="20" ... />

BTW - if you want further info, post to the js …

Jump to Post

All 5 Replies

What do you mean by this, in more details?

Member Avatar

If you're talking about a js popup, then I don't think it's possible. However modal dialogs like jQueryUI popups, which may serve a similar purpose for you can be controlled as you can use a <input maxlength="20" ... />

BTW - if you want further info, post to the js forum, not php.

I have called following javascript function onclick

<script type="text/javascript">
        function getValue(){
           var retVal = prompt("Why you want to apply this job? : ", "write here");
           alert("You have entered : " +  retVal );
        }
    </script>

now how to set char limit in prompt box?

This cannot be done with the prompt() function, you shoul look towards the jQueryUI or something like that.

Member Avatar

Ok moving...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.