category entry javascript fix

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Ryan Higgins 2008-01-11 01:32:09 -06:00 committed by Joshua Ferraro
parent 3db9849709
commit d40c752671
2 changed files with 6 additions and 5 deletions

View file

@ -54,14 +54,15 @@
ok=1;
_alertString += "- description missing\n";
}
if (!isNum(ff.upperagelimit,0)) {
if (!isNum(ff.upperagelimit,0) && ff.category_type.value=='C') {
ok=1;
_alertString += "- upperagelimit is not a number\n";
_alertString += "- upperagelimit is not a number\n";
}
if (ok) { // if there is a problem
alert(_alertString);
return;
return false;
}
// if all is good
ff.submit();
@ -131,7 +132,7 @@
</li></ol>
</fieldset>
<fieldset class="action"><input type="submit" value="Save" onclick="Check(this.form);" /> </fieldset>
<fieldset class="action"><input type="button" value="Save" onclick="Check(this.form);" /> </fieldset>
</form>
<!-- /TMPL_IF -->

View file

@ -187,7 +187,7 @@ if ($op eq 'save' || $op eq 'insert'){
my $age = GetAge($newdata{dateofbirth});
my $borrowercategory=GetBorrowercategory($newdata{'categorycode'});
my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'});
if (($age > $high) or ($age < $low)) {
if (($high && ($age > $high)) or ($age < $low)) {
push @errors, 'ERROR_age_limitations';
$template->param('ERROR_age_limitations' => "$low to $high");
}