diff --git a/scheme/httpd/surflets/surflet-input-fields.scm b/scheme/httpd/surflets/surflet-input-fields.scm index bc58346..369a276 100644 --- a/scheme/httpd/surflets/surflet-input-fields.scm +++ b/scheme/httpd/surflets/surflet-input-fields.scm @@ -39,13 +39,13 @@ ,(field-attributes-default attributes) ,(field-attributes-others attributes)))))) -(define (make-simple-default-setter default-pred?) +(define (make-simple-default-setter default-pred? error-msg-types) (lambda (input-field value) (if (default-pred? value) (set-field-attributes-default! (input-field-attributes input-field) `(value ,value)) - (error "Default value must be a number or a string or a symbol." + (error (format #f "Default value must be ~a." error-msg-types) value)) (touch-input-field! input-field))) @@ -54,7 +54,7 @@ (define simple-default? string-or-symbol?) (define set-simple-field-default! - (make-simple-default-setter simple-default?)) + (make-simple-default-setter simple-default? "a string or a symbol")) (define (second-arg first second) second) @@ -76,7 +76,8 @@ (simple-field-maker "text" "number" number-field-default? number-field-transformer)) (define set-number-field-value! - (make-simple-default-setter number-field-default?)) + (make-simple-default-setter number-field-default? + "a number a string or a symbol")) ;;;;;;;;;;;;;;;;;;;;;; ;;; hidden input-field