Is it possible to oblige the user to include one word only (i.e. no space) in a field ?
Mar 5, 2002, 1:39 AM
Enthusiast (606 posts)
Mar 5, 2002, 1:39 AM
Post #6 of 8
Views: 2090
Depends on where you want to check. I would put it into the sub validate_record in db.cgi. That way, this is checked whenever a record is added or modified.
There you see a line starting with if ($#input_err+1 > 0) { ....
Add the code before this line:
if ($in{'fieldname'} =~ /\s/) { push (@input_err, "ERROR: <b>fieldname</b> must not contain whitespace");}
kellner
There you see a line starting with if ($#input_err+1 > 0) { ....
Add the code before this line:
if ($in{'fieldname'} =~ /\s/) { push (@input_err, "ERROR: <b>fieldname</b> must not contain whitespace");}
kellner