cyberninja
09-29-2011, 12:35 AM
what would i need to do to get checkbox to correspond to page im submitting to
heres what i have so far
[CODE]
<script type = "text/javascript">
function newPage(page) {
if (document.getElementById("chk1").checked) {
OpenWin = this.open(page,"CtrlWindow","top=80,left=100,screenX=100,screenY=80,width=550,height=460,toolbar=no,menubar=no,location=no, scrollbars=no,resizable=yes");
return false;
}
}
function closepop() {if (OpenWin != null) OpenWin.close() }
window.onunload = closepop;
</script>
</head>
<body>
<form name=”form” id=”form” action=”” method=”post”>
happy<input type=”text” name=”happy” id=”happy”/>
sad<input type=”text” name=”sad” id=”sad”/>
<input type=”submit” value=”submit”/>
</form>
<input type = "checkbox" name = "chk1" id = "chk1" onclick = "newPage('randomnewpage.com')">
<INPUT TYPE=SUBMIT VALUE="submit">
[CODE]
the problem with this it always opens the page when i click the checkbox and does not send that values from the form to the page that opens
what i cant seem to figure out is how to send the values from the form to the new page.
And when i hit the submit button its opens the submitted form data to the webpage that the checkbox designates instead of opening the new page when i click the checkbox and not waiting for the submit button.
is there a way i can get the checkbox to do those things or will i need to use something other than javascript for those functions
heres what i have so far
[CODE]
<script type = "text/javascript">
function newPage(page) {
if (document.getElementById("chk1").checked) {
OpenWin = this.open(page,"CtrlWindow","top=80,left=100,screenX=100,screenY=80,width=550,height=460,toolbar=no,menubar=no,location=no, scrollbars=no,resizable=yes");
return false;
}
}
function closepop() {if (OpenWin != null) OpenWin.close() }
window.onunload = closepop;
</script>
</head>
<body>
<form name=”form” id=”form” action=”” method=”post”>
happy<input type=”text” name=”happy” id=”happy”/>
sad<input type=”text” name=”sad” id=”sad”/>
<input type=”submit” value=”submit”/>
</form>
<input type = "checkbox" name = "chk1" id = "chk1" onclick = "newPage('randomnewpage.com')">
<INPUT TYPE=SUBMIT VALUE="submit">
[CODE]
the problem with this it always opens the page when i click the checkbox and does not send that values from the form to the page that opens
what i cant seem to figure out is how to send the values from the form to the new page.
And when i hit the submit button its opens the submitted form data to the webpage that the checkbox designates instead of opening the new page when i click the checkbox and not waiting for the submit button.
is there a way i can get the checkbox to do those things or will i need to use something other than javascript for those functions