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>"
|
||||||
"<div class='event-section'>"
|
"<div class='event-section'>"
|
||||||
"<h2>Form Events</h2>"
|
"<h2>Form Events</h2>"
|
||||||
"<input type='text' id='formInput' placeholder='Type something'>"
|
"<form id='formElement'>"
|
||||||
"<select id='formSelect'>"
|
"<input type='text' id='formInput' placeholder='Type something'>"
|
||||||
"<option value='option1'>Option 1</option>"
|
"<select id='formSelect'>"
|
||||||
"<option value='option2'>Option 2</option>"
|
"<option value='option1'>Option 1</option>"
|
||||||
"<option value='option3'>Option 3</option>"
|
"<option value='option2'>Option 2</option>"
|
||||||
"</select>"
|
"<option value='option3'>Option 3</option>"
|
||||||
|
"</select>"
|
||||||
|
"<button type='submit'>Submit Form</button>"
|
||||||
|
"</form>"
|
||||||
"<div id='formOutput'></div>"
|
"<div id='formOutput'></div>"
|
||||||
"</div>"
|
"</div>"
|
||||||
"<div class='event-section'>"
|
"<div class='event-section'>"
|
||||||
|
|
@ -63,6 +66,7 @@ HtmlElement* focusInput = new HtmlElement("focusInput");
|
||||||
HtmlElement* focusOutput = new HtmlElement("focusOutput");
|
HtmlElement* focusOutput = new HtmlElement("focusOutput");
|
||||||
HtmlElement* formInput = new HtmlElement("formInput");
|
HtmlElement* formInput = new HtmlElement("formInput");
|
||||||
HtmlElement* formSelect = new HtmlElement("formSelect");
|
HtmlElement* formSelect = new HtmlElement("formSelect");
|
||||||
|
HtmlElement* formElement = new HtmlElement("formElement");
|
||||||
HtmlElement* formOutput = new HtmlElement("formOutput");
|
HtmlElement* formOutput = new HtmlElement("formOutput");
|
||||||
HtmlElement* windowOutput = new HtmlElement("windowOutput");
|
HtmlElement* windowOutput = new HtmlElement("windowOutput");
|
||||||
HtmlElement* dragSource = new HtmlElement("dragSource");
|
HtmlElement* dragSource = new HtmlElement("dragSource");
|
||||||
|
|
@ -138,6 +142,11 @@ int main() {
|
||||||
formOutput->SetInnerHTML(std::format("<p><strong>Select Change:</strong> Value='{}'</p>", event.value));
|
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
|
// Window Events
|
||||||
// Resize event
|
// Resize event
|
||||||
body->AddResizeListener([&](ResizeEvent event) {
|
body->AddResizeListener([&](ResizeEvent event) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue