View Full Version : Change Value when clicking on option

12-20-2010, 01:30 AM
Hey. I would like to change a value of a text box when clicking on an option in a select tag. I would like to do this in JavaScript. Here's the code to the page:

<title>Send SMS or MMS online</title>
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
<form name="myform">
<textarea name="limitedtextarea" onKeyDown="limitText(this.form.limitedtextarea,this.form.countdown,160);"
<font size="1">(Maximum characters: 160)<br>
You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font>
This is for an SMS website, as I will use SMTP to send, but to retrieve I'll look into... Back on topic; When clicking on an option I need it to change a text box with the carrier, like if it has a carrier from AT&T, then to change it to the carrier T-Mobile with a click. How is this possible with JavaScript? Any help appreciated... Thanks! God Bless You and Happy Holidays!