📄 html-radio.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" import="java.util.*"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<html:base/>
<title><html:radio></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body bgcolor="white">
<h1><html:radio></h1>
<p><html:radio>标记生成一个单选框,示例代码如下:</p>
<font class="CodeStyle">
<html:form action="/test.do"><br>
<html:radio property="testRadio" value="testvalue1"/><br>
</html:form><br>
</font>
<p>它有一个value属性,用来指定当选中该单选框时ActionForm中对应的属性的值。下面是另一种单选框的用法:</p>
<font class="CodeStyle">
<html:form action="/test.do"><br>
<html:radio property="testRadio" value="value1">Choice1<br>
<html:radio property="testRadio" value="value2">Choice2<br>
<html:radio property="testRadio" value="value3">Choice3<br>
</html:form>
</font>
<p>在上面的代码中,单选框一共有三个,这三个单选框组成一个单选框组,只能选取其中一个。无论选中哪一个,它的值在提交
表单后都将赋给ActionForm中相对应的属性,如果三个单选框一个都没有选中,那么该属性的值将为一个空串。</p>
<p>
<a href="index.jsp">返回主页面</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -