form submit
This commit is contained in:
parent
616aadec3b
commit
01d5b1548d
1 changed files with 15 additions and 6 deletions
|
|
@ -28,12 +28,15 @@ HtmlElement* body = new HtmlElement("body", "<div id='container'>"
|
|||
"</div>"
|
||||
"<div class='event-section'>"
|
||||
"<h2>Form Events</h2>"
|
||||
"<input type='text' id='formInput' placeholder='Type something'>"
|
||||
"<select id='formSelect'>"
|
||||
"<option value='option1'>Option 1</option>"
|
||||
"<option value='option2'>Option 2</option>"
|
||||
"<option value='option3'>Option 3</option>"
|
||||
"</select>"
|
||||
"<form id='formElement'>"
|
||||
"<input type='text' id='formInput' placeholder='Type something'>"
|
||||
"<select id='formSelect'>"
|
||||
"<option value='option1'>Option 1</option>"
|
||||
"<option value='option2'>Option 2</option>"
|
||||
"<option value='option3'>Option 3</option>"
|
||||
"</select>"
|
||||
"<button type='submit'>Submit Form</button>"
|
||||
"</form>"
|
||||
"<div id='formOutput'></div>"
|
||||
"</div>"
|
||||
"<div class='event-section'>"
|
||||
|
|
@ -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("<p><strong>Select Change:</strong> Value='{}'</p>", event.value));
|
||||
});
|
||||
|
||||
// Submit Event
|
||||
formElement->AddSubmitListener([&]() {
|
||||
formOutput->SetInnerHTML("<p><strong>Submit:</strong> Form submitted successfully!</p>");
|
||||
});
|
||||
|
||||
// Window Events
|
||||
// Resize event
|
||||
body->AddResizeListener([&](ResizeEvent event) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue