Piyush
Piyush

Reputation: 5315

textbox issue regarding shrinking first time input text

i have a problem regarding the textbox. i have done the textbox auto expandable but when i insert the text first time then the textbox shrink in size from their original size.but my requirement is that when my text is exceeding the text box length then it auto expand. my code is

<script type="text/javascript">
        $(document).ready(function() {
            $('.txtStyle').autogrow();
        });
</script>

pls somebody suggest how ot is possible

Upvotes: 1

Views: 204

Answers (2)

Reigel Gallarde
Reigel Gallarde

Reputation: 65264

textbox don't autogrow... because it is not capable of multi lines... use textarea instead...

Upvotes: 0

Konerak
Konerak

Reputation: 39763

Try adding a minHeight to your autogrow:

$(document).ready (function() {
    $('.txtStyle').autogrow({
    minHeight: 20,
    lineHeight: 12
    });
})

Upvotes: 1

Related Questions