From 01d5b1548d2ebcd279aa7b48584420c837b68d7e Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Mon, 10 Nov 2025 21:42:00 +0100 Subject: [PATCH] form submit --- examples/AllEventHandling/main.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/examples/AllEventHandling/main.cpp b/examples/AllEventHandling/main.cpp index c673361..b477bc7 100644 --- a/examples/AllEventHandling/main.cpp +++ b/examples/AllEventHandling/main.cpp @@ -28,12 +28,15 @@ HtmlElement* body = new HtmlElement("body", "
" "
" "
" "

Form Events

" - "" - "" + "
" + "" + "" + "" + "
" "
" "
" "
" @@ -63,6 +66,7 @@ HtmlElement* focusInput = new HtmlElement("focusInput"); HtmlElement* focusOutput = new HtmlElement("focusOutput"); HtmlElement* formInput = new HtmlElement("formInput"); HtmlElement* formSelect = new HtmlElement("formSelect"); +HtmlElement* formElement = new HtmlElement("formElement"); HtmlElement* formOutput = new HtmlElement("formOutput"); HtmlElement* windowOutput = new HtmlElement("windowOutput"); HtmlElement* dragSource = new HtmlElement("dragSource"); @@ -138,6 +142,11 @@ int main() { formOutput->SetInnerHTML(std::format("

Select Change: Value='{}'

", event.value)); }); + // Submit Event + formElement->AddSubmitListener([&]() { + formOutput->SetInnerHTML("

Submit: Form submitted successfully!

"); + }); + // Window Events // Resize event body->AddResizeListener([&](ResizeEvent event) {