
May 25th, 2004, 12:06 PM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Javascript beating me up (Will need helmet soon!)
I have a form that contains an array that I need to be able to create a popup window, select a value in the child window, then on close run the value though a javascript function to insert it into the next available position in the array.
My function on the parent window looks like so:
Code:
function setCode(theBox){
elem = document.entry.elements;
for(i=0;i<elem.length;i++){
if(elem[i].name.match(/test\d+/)){
if(theBox.value==elem[i].value){
if(theBox.checked==false){
elem[i].value = "";
closeGap(elem[i]);
}
return false;
}
if(elem[i].value=="" && theBox.checked==true){
elem[i].value=theBox.value;
return false;
}
}
}
return false;
}
My child page contains the following:
I query the database for all tests that match their criteria then allow them to click on a checkbox to select the test. I then need to close the child page, run the checked test through the array on the parent page.
I have been beating my head against the wall for days on this one!
|