2013-10-11 25 views
0

我有一個用於同意條款和條件的複選框,並且用戶需要標籤中鏈接的條款。我已經嘗試做這樣的事情:struts 2.0允許標籤中的HTML爲複選框

<s:checkbox name="iagree" fieldValue="true" label="By entering, I acknowledge that I have read, understand, and agree to the 
<a href='/rules.pdf'>Official Rules</a>, <a href='/about-us/terms-of-use/'>Terms of Use</a>, and <a href='/about-us/privacy-policy/'>Privacy Policy</a>."/> 

遺憾的是,JSP是逃避我的標記,所以你實際看到的支架,標籤等是否有我可以補充,以確保屬性的HTML實際上用作HTML?

奇怪的是,我有一個struts無線電組,它允許標記很好。

回答

0

只需使用HTML <label>標記並放置複選框以及其中的文本和鏈接即可。並使用simple主題作爲<s:checkbox>標記。

<label> 
    <s:checkbox name="iagree" fieldValue="true" theme="simple"/> 
    By entering, I acknowledge that I have read, understand, and agree to the 
    <a href='/rules.pdf'>Official Rules</a>, 
    <a href='/about-us/terms-of-use/'>Terms of Use</a>, 
    and <a href='/about-us/privacy-policy/'>Privacy Policy</a>. 
</label>