From 8816d7cff991b7bbf46fc12dff48fc4f81123a08 Mon Sep 17 00:00:00 2001 From: gonzo Date: Fri, 9 Jun 2023 21:55:01 +0200 Subject: check last field before submitting form --- main.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index e90a92b..64dbdda 100644 --- a/main.c +++ b/main.c @@ -86,14 +86,16 @@ int main() { form_driver(form, REQ_DEL_PREV); break; case '\r': - unpost_form(form); - formactive = FALSE; - curs_set(0); - refresh(); - box(stdscr, 0, 0); - run_sim(form); - padscroll = 0; - prefresh(pad, padscroll, 0, 4, 1, HEIGHT-2, WIDTH-1); + if (E_OK == form_driver(form, REQ_VALIDATION)) { + unpost_form(form); + formactive = FALSE; + curs_set(0); + refresh(); + box(stdscr, 0, 0); + run_sim(form); + padscroll = 0; + prefresh(pad, padscroll, 0, 4, 1, HEIGHT-2, WIDTH-1); + } break; default: /* If this is a normal character, it gets */ -- cgit v1.2.3