php - 无法在 php 中选择下拉菜单时隐藏 div
问题描述
嗨,我有一个基于下拉选择 div 值的下拉菜单应该更改。默认情况下,它不显示并显示 div,如果我选择是,则显示一个文本框,而另一个 div 不隐藏。
<div class="col-sm-12">
<select name="full_part_time" id="full_part_time" onchange="if (this.value=='yes'){this.form['full_part_time_details'].style.visibility='visible'}else {this.form['full_part_time_details'].style.visibility='hidden'};">
<option value="no" <?php echo ($oppointArr['full_part_time'] == 'no')?'selected':''?>>no</option>
<option value="yes" <?php echo ($oppointArr['full_part_time'] == 'yes')?'selected':''?>>yes</option>
</select>
<?php
$visibleText = 'style="visibility:hidden;"';
if($oppointArr['full_part_time'] == "yes"){
$visibleText = 'style="visibility:visible;"';
}
?>
<input type="text" id="full_part_time_details" <?php echo $visibleText;?> value="After my retirement, I am not in full or part time employment or Service not engaged in any trade or business or profession till today. " readonly/>
<?php //print_r($oppointArr); ?>
<div class="droddownsselection">
<p>Service Candidates shall upload following documents along with service Affidavit. </p>
<ul style="list-style:none;">
<li>1. Retirement Order / Service Certificate.</li>
<li>2. Permission Letter from Employer</li>
<li>3. Proof of working during study period of LAW</li>
<li>4. Law T.C.</li>
</ul>
</div>
</div>
解决方案
推荐阅读
- parsing - 使用 Rascal 解析以注释开头的文件
- javascript - 单击模态的滚动条时,防止引导模态内的输入失去焦点
- javascript - 从 chrome 存储中检索日期对象不起作用
- r - 使用循环根据列标准在 R 中创建多个数据框
- amazon-redshift - Redshift WLM 内存分配剩余 (0%)
- sql-server - 如何比较 IN 列表区分大小写
- php - Wordpress 帖子或分类关系?
- permissions - 为什么“chown”和“chgrp”会改变目录的权限?它不是“chmod”!
- c# - 从 2 个对象属性创建一个双精度数组
- android - 无法登录谷歌游戏服务