[JSF] 在JavaScript里面怎么才能取到radio button的值?

hell9999 2007-10-19 10:38:14
在JavaScript里面怎么才能取到radio button的值?

<dt>学校:</dt>
<dd>
<h:selectOneRadio style="font:10pt" id="chumonSyubetsu" binding="#{Omw1001s01Bean.chumonSyubetsu}"
valueChangeListener="#{Omw1001s01Bean.changeAction}" onclick="submit();"
required ="true" >
<f:selectItem itemValue="0"itemLabel="一班"/>
<f:selectItem itemValue="1"itemLabel="二班"/>
<f:selectItem itemValue="2"itemLabel="三班"/>
<f:selectItem itemValue="3"itemLabel="四班"/>
</h:selectOneRadio>
</dd>
...全文
186 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hell9999 2007-10-19
  • 打赏
  • 举报
回复
OK 非常感谢
mxm_1123 2007-10-19
  • 打赏
  • 举报
回复
var radios = document.getElementsByName("formid:chumonSyubetsu");
for(i=0;i<radios.length;i++)
{
if(radios[i].checked)
alert(radios[i].value);
}

//其中formid就是你前面form的id
JavaServer Faces (JSF) is the standard Java EE technology for building web user interfaces. It provides a powerful framework for developing server-side applications, allowing you to cleanly separate visual presentation and application logic. JSF 2.0 is a major upgrade, which not only adds many useful features but also greatly simplifies the programming model by using annotations and “convention over configuration” for common tasks. To help you quickly tap into the power of JSF 2.0, the third edition of Core JavaServer™ Faces has been completely updated to make optimum use of all the new features. The book includes Three totally new chapters on using Facelets tags for templating, building composite components, and developing Ajax applications Guidance on building robust applications with minimal hand coding and maximum productivity–without requiring any knowledge of servlets or other low-level “plumbing” A complete explanation of the basic building blocks–from using standard JSF tags, to working with data tables, and converting and validating input Coverage of advanced tasks, such as event handling, extending the JSF framework, and connecting to external services Solutions to a variety of common challenges, including notes on debugging and troubleshooting, in addition to implementation details and working code for features that are missing from JSF Proven solutions, hints, tips, and “how-tos” show you how to use JSF effectively in your development projects Core JavaServer™ Faces, Third Edition, provides everything you need to master the powerful and time-saving features of JSF 2.0 and is the perfect guide for programmers developing Java EE 6 web apps on Glassfish or another Java EE 6-compliant application servers, as well as servlet runners such as Tomcat 6.

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧