codice:
<input type="text" name"c1" onkeypress="this.form.c2.value=30-this.value.length;" />

<input type="text" name="c2" size="2" value="30"/>
ciao