diff --git a/scheme/httpd/surflets/simple-surflet-api.scm b/scheme/httpd/surflets/simple-surflet-api.scm index 902fdb1..60da9fe 100644 --- a/scheme/httpd/surflets/simple-surflet-api.scm +++ b/scheme/httpd/surflets/simple-surflet-api.scm @@ -32,9 +32,9 @@ (lambda (exit) (map (lambda (query) (with-fatal-error-handler - (lambda (c m) + (lambda (c m) (exit - (get-results queries title + (get-results queries title (ask query 'bad-input-text)))) (ask query 'value bindings))) queries))))) @@ -107,9 +107,11 @@ (else (get-method standard message)))))) -(define (make-radio text choices) - (let* ((radios (make-radio-input-fields choices)) - (standard (standard-query text (car radios) "Please respond"))) +(define (make-radio text choices . maybe-insist) + (let* ((insist (:optional maybe-insist "")) + (radios (make-radio-input-fields choices)) + (standard (standard-query text (car radios) + (string-append "Please respond" insist)))) (lambda (message) (case message ((html-table-row) @@ -124,15 +126,9 @@ (get-method standard message)))))) (define (make-yes-no text yes-text no-text) - (let ((radio (make-radio text (list yes-text no-text)))) - (lambda (message) - (case message - ((bad-input-text) - (format #f "Please respond with ~s or ~s" - yes-text no-text)) - (else - (get-method radio message)))))) - + (make-radio text + (list yes-text no-text) + (format #f " with ~s or ~s" yes-text no-text))) (define (transform-string-to-query query) (if (string? query)