Hello,
I have a drop box that has a list of all the Recipients. Below the drop box, I also have checkboxes for the same list of Recipients. Once a recipient is selected from the drop box, I want the same(matching one) recipient's checkbox automatically checked. I am not sure how to do this. Is this something like the following? If not, what is the correct to do this?
form.<%=MComposeController.RECIPIENT%>[form.<%=MComposeController.SUBJECT%>.value].checked
Thanks,
Ngai
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Below is the javascript for it...
<script type="text/javascript">
function verifyForm(form) {
var error = "Error(s):\n\n";
if (form.<%=MComposeController.SUBJECT %>.value == "") {
error += "<%=MComposeController.SUBJECT %> is a required field.\n";
}
var hasRecipient;
for(i=0; i < form.<%=MComposeController.RECIPIENT %>.length; i++) {
if (form.<%=MComposeController.RECIPIENT %>.checked) {
hasRecipient = true;
break;
}
}
if (!hasRecipient) {
error += "<%=MComposeController.RECIPIENT %> is a required field.\n";
}
if (error != "Error(s):\n\n") {
alert(error);
return false;
}
}
</script>
I have a drop box that has a list of all the Recipients. Below the drop box, I also have checkboxes for the same list of Recipients. Once a recipient is selected from the drop box, I want the same(matching one) recipient's checkbox automatically checked. I am not sure how to do this. Is this something like the following? If not, what is the correct to do this?
form.<%=MComposeController.RECIPIENT%>[form.<%=MComposeController.SUBJECT%>.value].checked
Thanks,
Ngai
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Below is the javascript for it...
<script type="text/javascript">
function verifyForm(form) {
var error = "Error(s):\n\n";
if (form.<%=MComposeController.SUBJECT %>.value == "") {
error += "<%=MComposeController.SUBJECT %> is a required field.\n";
}
var hasRecipient;
for(i=0; i < form.<%=MComposeController.RECIPIENT %>.length; i++) {
if (form.<%=MComposeController.RECIPIENT %>.checked) {
hasRecipient = true;
break;
}
}
if (!hasRecipient) {
error += "<%=MComposeController.RECIPIENT %> is a required field.\n";
}
if (error != "Error(s):\n\n") {
alert(error);
return false;
}
}
</script>