jsp - Struts2 html checkbox not pre-checked -


<body>     <h3>register prize completing form.</h3>     <s:form action="register">           <s:textfield name="personbean.firstname" label="first name" />           <s:textfield  name="personbean.lastname" label="last name" />           <s:textfield name="personbean.email"  label ="email"/>           <s:textfield name="personbean.age"  label="age"  />           <input type="checkbox" checked="checked" />           <s:submit/>     </s:form>     <input type="checkbox" checked="checked" /> </body> 

i have jsp above content. checkbox within form not checked whereas checkbox outside form pre-checked. mixing plain html checkbox , non-html elements within struts2 form.

here have malformed html putting input tag in form.

to resolve it,you can use s:checkbox

<s:checkbox name="checkme" fieldvalue="true" label="check me testing" value="true"/> 

Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -