Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting values from checkboxes in another frame 1

Status
Not open for further replies.

dpm8

Programmer
Dec 14, 2004
8
0
0
US
Howdy folks,

This one has been driving us nuts. We're working with two frames. The top one has two buttons. The bottom one has a bunch of check boxes that are all in the same group but have different values. When we press either of the buttons, it's supposed to shoot us to a php page that we made.

So we're using javascript on the buttons in the top frame to post the form in the bottom frame. However, due to some error handling, we've got to get a value or the length or anything that will give us information that show us if any boxes have been checked when we press either of the buttons in the top frame.

This code doesn't work. Can anyone suggest any changes?

Code:
//gen_bottom is the frame name where the form is located

<SCRIPT language="JavaScript">
function submitform()
{
	if(top.frames.gen_bottom.ClickDragForm.check.value > 0)
	{
	    alert("Checked");
	    top.frames.gen_bottom.ClickDragForm.submit();
	}
	else
	{
	    alert("not Checked");
	}
}
function submitform2()
{
  top.frames.gen_bottom.ClickDragForm.button_select.value = "addwork";
  top.frames.gen_bottom.ClickDragForm.submit();
}
</script>
 
Code:
//gen_bottom is the frame name where the form is located

<SCRIPT language="JavaScript">
function submitform()
{
    if(top.frames.gen_bottom.[b]document.[/b]ClickDragForm.check.value > 0)
    {
        alert("Checked");
        top.frames.gen_bottom.[b]document.[/b]ClickDragForm.submit();
    }
    else
    {
        alert("not Checked");
    }
}
function submitform2()
{
  top.frames.gen_bottom.[b]document.[/b]ClickDragForm.button_select.value = "addwork";
  top.frames.gen_bottom.[b]document.[/b]ClickDragForm.submit();
}
</script>

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top