how to set char limit in prompt box using javascript?

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...