开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜