The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Radio buttons message question, HTML beginner seeking a little help
PeterR
post Mar 16 2023, 12:03 AM
Post #1





Group: Members
Posts: 3
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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 06:45 AM