View Full Version : What should I add or remove?

12-12-2008, 07:25 PM
I was wondering if anyone could tell me anything I should add or remove, or anything on my contact forms


There is 2 versions of the contact form, one uses OpenCaptcha while the other uses MathCaptcha.

I know the website looks bleh, I need feedback on the contact forms themselves.


12-12-2008, 07:51 PM
Were I in your position, I'd add some form of JavaScript validation (plus the server-side you already have, of course.)

12-12-2008, 07:59 PM
the only javascript i can do is copy/paste. why add javascript validation? why have 2 when theres already one. could you explain why?

12-12-2008, 08:02 PM
The javascript happens on the client machine. No network/internet traffic involved. That makes it faster and cheaper.

12-12-2008, 08:03 PM
i dont know javascript, so i have no idea how to add it

12-12-2008, 08:07 PM
the only javascript i can do is copy/paste. why add javascript validation? why have 2 when theres already one. could you explain why?
two reason pro:
- can help user with form validation before pushing submit to check with php
- afaik bots don't interpret javascript, you can use this to avoid spam

best regards

12-12-2008, 08:33 PM
cant bots disable JS? anyway, i dont know how to code JS, im trying to find a JS form validation to look at now.

12-12-2008, 08:43 PM
I use a JS submit once script in the form. which uses the OnSubmit tag inside the <form> area, can you use 2 OnSubmit tags? once for submit once, and one for JS form validation?

12-12-2008, 08:47 PM
function validateEmpty(fld) {
var error = "";

if (fld.value.length == 0) {
fld.style.background = 'Yellow';
error = "The required field has not been filled in.\n"
} else {
fld.style.background = 'White';
return error;

This is called by:

function validateFormOnSubmit(theForm) {
var reason = "";

reason += validateUsername(theForm.username);
reason += validatePassword(theForm.pwd);
reason += validateEmail(theForm.email);
reason += validatePhone(theForm.phone);
reason += validateEmpty(theForm.from);

if (reason != "") {
alert("Some fields need correction:\n" + reason);
return false;

return true;

This is called by:

<form name="demo" onsubmit="return validateFormOnSubmit(this)" action="test.htm">
<table summary="Demonstration form">
<td><label for="username">Your user name:</label></td>
<td><input name="username" size="35" maxlength="50" type="text"></td>
<td><label for="pwd">Your password</label></td>
<td><input name="pwd" size="35" maxlength="25" type="password"></td>
<td><label for="email">Your email:</label></td>
<td><input name="email" size="35" maxlength="30" type="text"></td>
<td><label for="phone">Your telephone number:</label></td>
<td><input name="phone" size="35" maxlength="25" type="text"></td>
<label for="from">Where are you :</label></td>
<td><input name="from" size="35" maxlength="50" type="text"></td>
<td><input name="Submit" value="Send" type="submit" ></td>

This is from this page (http://webcheatsheet.com/javascript/form_validation.php#required)

Disclaimer: I don't advocate using tables to format the form. I only put one of the tests as an example.

12-12-2008, 08:52 PM
thanks, I will add javascript validation for the contact form in my next update.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum