Ok, now I've tried 1 hour, but no outcome.
What I don't understand about your codes (because I've no idea what it actually means/does) is this
You made no mistake in there? I can't check it with my knowledge.
All other combinations I've tried out, I believe. When I 'translate' your codes you say 'if the entry for the title of a record contains an error, setup $errmsg to show a red "X". Ok, that's fine. But since there can be more than one field with an error in it at a time, I could use some $errmsg1, $errmsg2, ... to differ between the possibilities.
But that's the next step, first of all it's not showing any
X when I leave the Title-field blank.
One more thing: what's the reason you want to set up $rec at the top of the sub and later on say if it contains a value than print
X and if not just print
Title? Couldn't I put this in just one
if clause saying 'if there's something print it, if not - not'?.
Hm, hope you get the points out of my bla bla.
Denis
Btw: the script already does what I want to do in some way: it says for example
Title - cannot be left blank only in case the title is left blank. I could change this sentence to say
X only, delete the stuff with the
<li> listing and set each errormessage to one variable containing its
X and then say something like
if ($variable_for_title_error ne "") {print qq~$variable_for_title_error~;}. And then a big large red
X would show the user the place where he made his mistake in the add-form.
But I'd really miss the nice 'cannot be left blank' note at the top. Therefore I took a look at
db_utils.pl where I've found the 'cannot be left ...'-stuff - but all being put in a list here:
Code:
if ($#input_err+1 > 0) { # since there are errors, let's build
foreach $err (@input_err) { # a string listing the errors
$errstr .= "<li>$err"; # and return it.
}
return "<ul>$errstr</ul>";
and I wasn't able to figure out how to extract each single error out of the $errstr.
Cool, that's a lot bla bla
[This message has been edited by Denis (edited March 16, 2000).]