0
他の要素に基づいて1つの要素を非表示にしたい。認証タイプの値は、それがチェックボックスを隠さないDBから来るときjsp要素を他の要素に基づいて非表示/非表示
DMAINC.module.security.User.removeExpirePassword = function(tabId)
{
var auth = document.getElementById("authImpl_" + tabId).value;
if(auth=="com.dmainc.commons.security.service.jaas.JAASAuthenticator"){
var doc = document.getElementById("expireOnLogin");
doc.style.display = "none";
}
else{
alert(2);
var doc = document.getElementById("expireOnLogin");
doc.style.display = "";
}
};
ITSは、そのだけ働いて、細かい作業が、私はselectを使用して変更した場合、私がしたい:私は以下のように実装している
<table class="entry" >
<tr>
<th><s:text name="security.user.label.authentication-type" /></th>
<td><s:select
name="currentUser.authImpl"
onchange="DMAINC.module.security.User.removeExpirePassword('%{tabId}');"
list="@[email protected]()"
headerKey=""
headerValue="[Please Select]"
listKey="classname"
id="authImpl_%{tabId}" /></td>
</tr>
<tr id="expireOnLogin" >
<th><s:text name="security.user.label.expire-password" /></th>
<td><s:checkbox id="expireOnLog" name="expireOnLogin"/></td>
</tr>
</table>
両方のシナリオでチェックボックスを非表示にするには、最初に値がselectでdbから来ていて、UIから変更した場合。私はまた、ifステートメントを使用して隠そうとしましたが、selectを変更するとexpireOnLogin idが見つかりません。あなたが編集コンテンツの伝承をクリックした場合の例が与えられている。ここ