开发者

radiobutton issue

开发者 https://www.devze.com 2023-03-14 09:17 出处:网络
I created a radio button using html tags like the following, 开发者_Python百科 <input type=\"radio\"

I created a radio button using html tags like the following,

开发者_Python百科
<input type="radio"
       value="NO"
       class="check"
       name="courseType"
       <%="NO".equals(request.getParameter("courseType"))?"checked=\"checked\"":""%>
       onchange="submitForm()"/>
<label for="normal">Normal</label>

now it is working fine.Here i want to implement same scenario using struts1.2

Note: while clicking on radio button i need to submit form and it should be checked (<%="NO".equals(request.getParameter("courseType"))?"checked=\"checked\"":""%> )

here i am created using struts like the following way

<html:radio property="courseType"
            value="FE"
            onchange="subminForm()"
            styleClass="check" />
<label for="normal">Normal</label>

But how could i submit and checked the radio button...?


I think you can use struts tag libraries to solve this problem, where you will use bean to store the state of the radio button. And check the state in the struts action class.

0

精彩评论

暂无评论...
验证码 换一张
取 消