Click to See Complete Forum and Search --> : A problem with checkbox/submit...


D.S.R.Clark
11-07-2003, 07:37 PM
I am having difficulties with a piece of code that I got on the Javascript page. It is a "check if you agree", submit button that goes to the next page. I am just getting the site up on the server and trying to get it all hooked together. I get a n error " this method of POST not allowed for this url..."

<form action="http://elizabethstewartclarkandcompany.com/CC/CC3/CC3.3/CC3.5.htm" method="POST" onsubmit="return checkCheckBox(this)">
<p align="center"><u><b><font size="4">I accept:</font></b></u> <input type="checkbox" value="0" name="agree">&nbsp;&nbsp;
<input type="submit" value="Continue to Next Step!">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="EXIT" onclick="window.close();">


any thoughts???

Thank you in advance,
David

KeithMcL
11-07-2003, 09:17 PM
Can you post the javascript code, so we can check it?

D.S.R.Clark
11-08-2003, 11:28 AM
Here is the page. Its rather small. It worked just fine in my compter, but not on the web.


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>~~Terms of Agreement- Elizabeth Stewart Clark &amp; Co.~~</title>
<meta name="Microsoft Border" content="none">

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please check the box if you AGREE with the terms!.');
return false;
}else
return true;
}
// End -->
</script>

</head>

<body bgcolor="#000000">
<div align="center">
<center>
<table border="1" cellpadding="4" cellspacing="4" style="border-collapse: collapse" bordercolor="#111111" width="425" height="445" bgcolor="#C1AF94">
<tr>
<td width="100%">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="370" height="365">
<tr>
<td height="335">


<div align="center">
<center>
<table border="3" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="325">
<tr>
<td width="100%">
<p align="center">
<iframe name="I1" width="353" height="326" src="../../../Admin/A3/B/LD/LD3/EULA.htm" align="middle">
Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></td>
</tr>
</table>
</center>
</div>
<form action="http://elizabethstewartclarkandcompany.com/CC/CC3/CC3.3/CC3.5.htm" method="POST" onsubmit="return checkCheckBox(this)">
<p align="center"><u><b><font size="4">I accept:</font></b></u> <input type="checkbox" value="0" name="agree">&nbsp;&nbsp;
<input type="submit" value="Continue to Next Step!">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="EXIT" onclick="window.close();">
</p>
</form>
</form></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>

</center>
</div>

</body>

</html>



Thank you for your help!!
David Clark

D.S.R.Clark
11-08-2003, 12:50 PM
Ok what about this one?

<form action="/yourscript.cgi-or-your-page.html"

is this where I put the page to go to if they agree??





<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Colin Pc -->
<!-- Web Site: http://www.insighteye.com/ -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please check the box to continue.');
return false;
}else
return true;
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<form action="/yourscript.cgi-or-your-page.html" method="POST" onsubmit="return checkCheckBox(this)">
I accept: <input type="checkbox" value="0" name="agree">
<input type="submit" value="Continue Order">
<input type="button" value="Exit" onclick="document.location.href='/index.html';">
</form>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.21 KB -->

KeithMcL
11-08-2003, 12:58 PM
Try changing the action in the form tag to just # and then in the javascript code change it from:
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please check the box to continue.');
return false;
}else
return true;
}to
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please check the box to continue.');
return false;
}else
window.location='pagename.html';
}

D.S.R.Clark
11-08-2003, 03:28 PM
I am still a little new at this.

I understand the addition of code you gave me, but I do not understand # in the tag???

KeithMcL
11-08-2003, 07:44 PM
The # just stops the action in the form tag from actually running an action. You could leave it blank too. It doesn't have any special meaning.

D.S.R.Clark
11-09-2003, 01:21 AM
Method Not Allowed
The requested method POST is not allowed for the URL /CC/CC3/CC3.3/CC3.5.htm.


--------------------------------------------------------------------------------

Apache/1.3.28 Server at www.elizabethstewartclarkandcompany.com Port 80


This iswhat I have been getting each time the check is placed the the "next" button clicked.:(

KeithMcL
11-09-2003, 10:18 AM
I can't see this making any difference but try changing POST to lowercase letters. Your host might have the POST method disabled for some strange reason. Contact them to see.