I have a script which gets data from a form field in one window and puts it into a corresponding form field in another window. This script is repeated 5 times, once for each weekday. The script looks like this:
function receiveDataFriday_Entree(frm)
{
var str = "\n", fld;
for (var i=0; i<frm.elements.length; i++) {
fld = frm.elements[i];
if (fld.type == 'radio') {
if (fld.checked) {
str += fld.value;
}
}
window.opener.document.menuPlanner.Friday_Entree.value = str;
}
I end up calling the script 5 times, specifying the different days of the week, but I know there's a better way to do this. Can someone tell me how I can define an array in Javascript so that I only have to call the script once?
Bookmarks