I am stuck!
I want to populate a textbox with the content of another textbox based on whether a radio button has been clicked.
Here is the javescript code:
function setValue() {
if (document.frmOcc.rbFirstContact[1].checked) {
document.frmOcc.txtArriveEvent.value=document.frmOcc.txtOffReportArrive.value;
return true;
}
else if (document.frmOcc.rbFirstContact[0].checked) {
alert("Did you attend the Event?")
document.frmOcc.txtArriveEvent.focus();
return true;
}
}
Here is how I am calling it:
<label>
<input type="radio" name="rbFirstContact" onClick="setValue(this.form)" value="Phone">
Phone</label>
(if phone, did Officer go to Event?) <br>
<label>
<input type="radio" name="rbFirstContact" onClick="setValue(this.form)" value="Seen">
Seen</label>
(if seen, populate Arrived at Event) <br>
Can anyone see what I am doing wrong?
Thanks!
I want to populate a textbox with the content of another textbox based on whether a radio button has been clicked.
Here is the javescript code:
function setValue() {
if (document.frmOcc.rbFirstContact[1].checked) {
document.frmOcc.txtArriveEvent.value=document.frmOcc.txtOffReportArrive.value;
return true;
}
else if (document.frmOcc.rbFirstContact[0].checked) {
alert("Did you attend the Event?")
document.frmOcc.txtArriveEvent.focus();
return true;
}
}
Here is how I am calling it:
<label>
<input type="radio" name="rbFirstContact" onClick="setValue(this.form)" value="Phone">
Phone</label>
(if phone, did Officer go to Event?) <br>
<label>
<input type="radio" name="rbFirstContact" onClick="setValue(this.form)" value="Seen">
Seen</label>
(if seen, populate Arrived at Event) <br>
Can anyone see what I am doing wrong?
Thanks!