Validate part of form - help needed

Hi guys, I’m new to PHP and I’m trying to sort out a site at work.
We have a form that users fill in and at the moment we have a message come up if they leave it blank, however, I need to be able to (if possible) force them to do it correctly.
They are putting in a code that MUST have 3 letters (no numbers) at the start followed by any number of numbers (no letters)

Can anyone help a beginner?

currently we use:

[php] {
if(document.all.description2.value == “”)
{
alert(“You need to fill in the URN field. This MUST begin with 3 letters”);
return false;
}

		}[/php]

thanks in advance for any help

Can you please post the complete code? I’m not able to Identify the issue with the above code pasted. It seems fine.

for some reason the main bit that’s not working has gone missing from my post (it was there yesterday!)

if(document.all.temp1.str=="Shape Creation Request" and document.all.temp11.value.length <22) { alert("Please provide the full publication code including edition."); return false; }

actually never mind, wrong post, the above is sorted but I cannot find any way to delete or edit posts on here!

Sponsor our Newsletter | Privacy Policy | Terms of Service