简体   繁体   中英

default radio to yes in struts 1.3

<nested:radio property="sendFlag" value="Yes" onclick="showDiv();" />Yes<nested:radio property="sendFlag" value="No" onclick="hideDiv();" />No

The above code defaults to No, on my jsp. Is there a way in which I can allow the Yes button to be selected by default

On your ActionForm where sendFlag attribute is found, do this:

private boolean sendFlag = true;

If that doesn't work, override the reset() method by setting the sendFlag to true.

That way, when Struts renders the sendFlag , it will tick it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM