View Full Version : Javascript form validation help

02-18-2009, 07:45 PM
I am 95% there, but since I am not a Javascript or web developer by trade, I couldn't beat this into submission. Any help would be greatly appreciated.

I have this simple script that evaluates text input fields and a checkbox that someone must check before proceeding. "agreement" is the checkbox name/id. I have this working without any problems when I use text fields but when I introduce the checkbox it does not seem to work.

Any help is greatly appreciated! Thanks in advance.

<form onsubmit="return checkForm(this)">
<input name="agreement" type="checkbox" id="agreement" value="1" />

<script type="text/javascript">
function checkForm(frm){
msg = "";

msg += "- First name is required\n";

msg += "- Accept the terms of use\n";


if(msg != ""){
return false;

02-21-2009, 01:41 PM
From my understanding, you would just like to make this 'required' before processing? Is this just a simple e-mail form?