jquery - textarea maxlength dropdown menu -


i have dropdown menu 3 values , depending on value select in menu want textarea maxlength change. possible or can work?

i have looked @ jquery val() , change() not got work.

/best regards

you can use like

<input id="myinput" type="text" maxlength="2">  <select>   <option onclick='changemaxlength(2)'>2</option>   <option onclick='changemaxlength(5)'>5</option>   <option onclick='changemaxlength(10)'>10</option> </select> 

and jquery

function changemaxlength(length) {     jquery("#myinput").attr('maxlength', length);   } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -