validate_ad_dateentrywidget

one of the documented procedures in this installation of the ACS
Usage:
validate_ad_dateentrywidget   field_name   column   form   { allow_null "0" }
What it does:
Defined in: /web/philip/packages/acs-core/utilities-procs.tcl

Source code:


    set col [ns_urlencode $column]
    set day [ns_set get $form "ColValue.$col.day"]
    ns_set update $form "ColValue.$col.day" [string trimleft $day "0"]
    set month [ns_set get $form "ColValue.$col.month"]
    set year [ns_set get $form "ColValue.$col.year"]

    # check that either all elements are blank
    # date value is formated correctly for ns_dbformvalue
    if { [empty_string_p "$day$month$year"] } {
	if { $allow_null == 0 } {
	    error "$field_name must be supplied"
	} else {
	    return ""
	}
    } elseif { ![empty_string_p $year] && [string length $year] != 4 } {
	error "The year must contain 4 digits."
    } elseif { [catch  { ns_dbformvalue $form $column date date } errmsg ] } {
	error "The entry for $field_name had a problem:  $errmsg."
    }

    return $date


philg@mit.edu