私はドロップダウンリストとドロップダウンリストの値に基づいて表示と非表示のテキストを持つPHPフォームを持っています。問題は、[送信]ボタンをクリックしたときに、オンロード機能の作業とテキストの非表示のバリデーションエラーです。ドロップダウンリストに応じて表示または非表示にしておく必要があります。ここでJS show hide投稿をクリックしたときに表示されます
はイムがやって何です:負荷に体にここにhidefield関数を呼び出す
<script type="text/javascript">
function showfield(name){
if(name != 'High School')
document.getElementById('div1').style.display="block";
else
document.getElementById('div1').style.display="none";
}
function hidefield() {
document.getElementById('div1').style.display='none';
}
<script>
イム:
ドロップdownlist<select name="education" size="1" class="text" id="education" onchange="showfield(this.options[this.selectedIndex].value)">
上
<body onload = "hidefield()">
およびその他の機能誰かが助けてくれることを願っています
任意のアイデアをごhidefield機能を変更しますか?私が望むようにまだ動作していません – user1084949