TUT/test_form.html
m1ngsama 58b7607074 feat: Add interactive dropdown selection for forms
- Parse and store OPTION elements in SELECT fields
- Display selected option text in dropdown UI
- Add SELECT_OPTION input mode for dropdown navigation
- Support Enter on SELECT to enter selection mode
- Use j/k or arrow keys to navigate through options
- Enter to confirm selection, Esc to cancel
- Auto-select first option or option marked with 'selected'
- Real-time option preview in status bar
- Status bar shows "-- SELECT --" mode

Data structure:
- Added options vector to DomNode (value, text pairs)
- Added selected_option index to track current selection

Keyboard shortcuts in SELECT mode:
- j/Down: Next option
- k/Up: Previous option
- Enter: Select current option
- Esc: Cancel selection
2025-12-28 00:03:39 +08:00

39 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Form Test</title>
</head>
<body>
<h1>Test Form</h1>
<form action="/submit" method="POST">
<p>Name: <input type="text" name="name" placeholder="Enter your name"></p>
<p>Email: <input type="text" name="email" placeholder="email@example.com"></p>
<p>Password: <input type="password" name="password"></p>
<p>Country: <select name="country">
<option value="">Select a country</option>
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
<option value="ca">Canada</option>
<option value="au">Australia</option>
</select></p>
<p>Age Group: <select name="age">
<option value="18-25" selected>18-25</option>
<option value="26-35">26-35</option>
<option value="36-50">36-50</option>
<option value="51+">51+</option>
</select></p>
<p><input type="checkbox" name="subscribe"> Subscribe to newsletter</p>
<p><input type="checkbox" name="agree"> I agree to terms</p>
<p><input type="submit" value="Submit Form"></p>
<p><button>Click Me</button></p>
</form>
<h2>Links</h2>
<p><a href="https://example.com">Example Link</a></p>
</body>
</html>