Webmaster Forums Banner Professional Hosting from Just Host
Welcome Guest Search | Active Topics | Members | Log In | Register

Year field validation Options
zara
Posted: Thursday, June 05, 2008 10:53:37 AM
Rank: Member
Groups: Member

Joined: 5/29/2008
Posts: 29
Points: 87
Location: California
i need a regular expression for just year like 1988.....

this is the year code


Code:
<select name="YearEstablished">
<option value="">yyyy</option>
<?php
for ($i=2005; $i>=1900; $i--)
{
echo "<option value='$i'";
if ($fields["YearEstablished"] == $i)
echo " selected";
echo ">$i</option>";
}
?>
</select>

here is the regular expressions am using

Code:
$rules[] = "required,YearEstablished,Please enter a xxxxxxxxxxxxxxxxxx.";
$rules[] = "reg_exp,YearEstablished,^[0-9{4}],YearEstablished: XXXXXXXXX (Valid: a-z 0-9 space and dash.)";



here is my error

YearEstablished: Invalid charachters detected. (Valid: a-z 0-9 space and dash.)
Sponsor
Posted: Thursday, June 05, 2008 10:53:37 AM
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by HaqTech.Com
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.559 seconds.