Radio buttons message question, HTML beginner seeking a little help |
Radio buttons message question, HTML beginner seeking a little help |
PeterR |
Mar 16 2023, 12:03 AM
Post
#1
|
Group: Members Posts: 4 Joined: 15-March 23 Member No.: 28,855 |
I have the following 15 line index.html file which displays 2 radio buttons and prompts visitor to select button 1 or 2.
I also provided a [Submit] button. Would someone please tell me how to display a message if [Submit] is clicked? for example a message like so: "Button 1 was selected." or "Button 2 was selected." ................ <!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>Domain Title</title> <body> <form> <p>Select button 1 or 2<p> <input type="radio" name = "ans" value="button #1"> button1 </br> <input type="radio" name = "ans" value="button #2"> button2 </br> </br> <button type="button">Submit</button> </form> </body> </html> |
Lo-Fi Version | Time is now: 24th September 2024 - 11:51 PM |