One way of doing this is to check all your variables when you submit the form.
-) Change your <input type='submit'> to <input type='button' onClick='varCheck()'>
-) Add the JavaScript function to check all the textfields you want to validate.
function varCheck()
{
error=0;
lastname = document.form.lastname.value;
if(lastname.length =< 3)
{
error=1;
alert("Error: Minimum length of text is 3 character long.");
}
// insert all your other variable checks here in the same format as above
if(error==0)
{
document.form.submit();
}
}
This way, your users can enter whatever they want; but it will only check the varibles when their trying to submit the form - and only successfully submit if there are no errors in the variables.
If you do something like this, you will probably also want to double check all your variables in PHP when you're pulling them out of your GET/POST.