I have a form that will be used for incoming calls to Customer Service. On the form are text boxes for Callers info and Senders Info. If the caller IS the sender, I want the data entered into Callers info to show up in the Senders text boxes as soon as the data is entered. I am trying to use onBlur to call a function that checks if the caller is the sender. I can't get the data to show up in the Senders text boxes. Here is the function I have been trying to use followed by the HTML portion of the code. I call the function after the phone number is entered. (This is my first request for help--Please let me know if I can give better info)
function CallerIsSender() {
var iCallerFirst = document.forma.callerfirstname.value;
var iCallerLast = document.forma.callerlastname.value;
if (document.forma.requestor(0).checked == true)
document.forma.senderfirstname.value = document.forma.callerfirstname.value;
document.forma.senderlastname.value = document.forma.callerlastname.value;
}
<table align="center" border="0" cellspacing="0" cellpadding="2" width="700">
<tr>
<td align="center" bgcolor="##CCFFFF">Callers Phone#: <br>
1 - (
<small><input type="text" onKeyUp="return autoTab(this, 3, event);" name="areacode" size="4" maxlength="3"></small>) -
<small><input type="text" onKeyUp="return autoTab(this, 3, event);" name="prefix" size="4" maxlength="3"></small> -
<small><input type="text" onBlur="return autoTab(this, 4, event);return CallerIsSender;" name="phonefour" size="5" maxlength="4"></small>
</td>
</tr>
</table>
function CallerIsSender() {
var iCallerFirst = document.forma.callerfirstname.value;
var iCallerLast = document.forma.callerlastname.value;
if (document.forma.requestor(0).checked == true)
document.forma.senderfirstname.value = document.forma.callerfirstname.value;
document.forma.senderlastname.value = document.forma.callerlastname.value;
}
<table align="center" border="0" cellspacing="0" cellpadding="2" width="700">
<tr>
<td align="center" bgcolor="##CCFFFF">Callers Phone#: <br>
1 - (
<small><input type="text" onKeyUp="return autoTab(this, 3, event);" name="areacode" size="4" maxlength="3"></small>) -
<small><input type="text" onKeyUp="return autoTab(this, 3, event);" name="prefix" size="4" maxlength="3"></small> -
<small><input type="text" onBlur="return autoTab(this, 4, event);return CallerIsSender;" name="phonefour" size="5" maxlength="4"></small>
</td>
</tr>
</table>
Comment