Stack Exchange
JQuery: if else on select dropdown
Hopefully I can get help from you guys..I got a simple script below but not sure why is this not working. 
Wanted to limit the text length of the textarea depends on the select dropdown value. Please advise.
HTML:
<select class="productoptionname_card-type" id="Option111453" name="Option111453">                                  
<option value="">Please select...</option>
<option value="1127125">Free Message Card</option>
<option value="1127126">Greeting Cart</option>
</select>
<textarea class="productoptionname_message" style="width: auto" tabindex="5"></textarea>
<span id="charsLeft"></span>

JQuery:
<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="http://jquery-limit.googlecode.com/files/jquery.limit-1.2.source.js" type="text/javascript"></script>
    <script language="javascript">
function ResetText() {
    if ( $('#Option111453 option:selected').text() == "Free Message Card" ) {
        $('textarea.productoptionname_message').limit('5','#charsLeft');
    }
    else if ( $('#Option111453 option:selected').text() == "Greeting Cart" ) {
        $('textarea.productoptionname_message').limit('10','#charsLeft');
    }
}
$().ready(function() {
    $('textarea.productoptionname_message').keyup(function() { ResetText(); });
    $('#Option111592').change(function() { ResetText(); });
});
</script>

Thanks much!

First off Function won't work.. Or is that a typo? Javascript is case-sensitive.

You're using a plugin for the limit function right?

You html and javascript  are not matching.

what is charsLeft doing?

thanks guys..have updated the typo..@xdazz why is it not match? @book its the counter..@sje397 yes I using the limit function(http://jquery-limit.googlecode.com/files/jquery.limit-1.2.source.js)

there's nothing in the , do you need a default value? like 10

@Book OF Zeus it will automatically populate using the limit plugins..see above link. Thanks.

The extension (JQuery.limit) not works properly.
I just write a custom jquery limit extension for you.
you can test it here: http://jsfiddle.net/tcWHr/
