Jump to content

Mailform Question: How do I get form validation to work on a checkbox?


blastbum

Recommended Posts

Hi,

I'm a php newbie, so please be nice.  :)

For some reason, my form validation isn't working. To see what I mean, go to [url=http://www.ds-d.com/message.php]http://www.ds-d.com/message.php[/url] You should only be able to progress to the "Statement" page if the "I Agree" checkbox has been checked. Currently, you can go to the "statement.php" page without the "I Agree" checkbox being checked. I'd love to know why it's not working.

I have attached the relevant files.

If you could supply me the correct code that would make the validation work, I would be very grateful.

Thank you.

Dan Secomb

[attachment deleted by admin]
try changing the javascript to

<script language="JavaScript">
<!--

function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('You must check the box to continue to view the \'Statement\' page.');
return false;
}else
return true;
}
//  End -->
</script>
Hi Kobmat,

I was just wondering whether you knew how to get the users IP address to appear on the emails "From" field. Currently, it's this email address "[email protected]" that's appearing in the "From" field.

I think this line may have something to do with it:
$ip = $_SERVER['REMOTE_ADDR'];

If you could let me know how to do that, I would be most grateful.

Thank you.

Dan Secomb

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.