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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -