当我点击不同的单选按钮时,文本框隐藏 [英] Text Box Hides When I Click On Different Radio Button

查看:78
本文介绍了当我点击不同的单选按钮时,文本框隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个文本框和单选按钮,当我单击一个单选按钮显示文本框然后输入详细信息,然后单击下一个单选按钮。我之前的文本框隐藏了。我只能在文本框上看到。



代码:

< script>

$(input [type ='radio'])。click(function(){

if($(this).val()===yes)

$('#textbox1')。show();

else

$('#textbox1')。hide();

});



$('input')。click(function(){

$('input [name =licform]:选中')。val();

if($(this).val()===no1)

$( #table)。show();

else

$(#table)。hide();

});

< / script>



I have multiple text boxes and radio buttons , when i click on one radio button to display text box then and enter details , then i click on next radio button . my previous text box hides . There is only on text box that i can see at a time .

code :
<script>
$("input[type='radio']").click(function(){
if($(this).val() === "yes")
$('#textbox1').show();
else
$('#textbox1').hide();
});

$('input').click( function() {
$('input[name="licform"]:checked').val();
if($(this).val()=== "no1")
$("#table").show();
else
$("#table").hide();
});
</script>

<h4>1. AREA OF OPERATION</h4>
                        <p>Temporary Extension of Area &nbsp; &nbsp; &nbsp; <label>Yes</label><input type="radio" name="type" value="yes" /> &nbsp; &nbsp; &nbsp;  <label>No</label><input type="radio" name="type"  value="no" /></p>
                        <p> <textarea id="textbox1" hidden="true" rows="7" cols="150" placeholder="Enter details & its reason with effect from extended area reasons for extension"></textarea>
                 </td></tr>



< p> i。拥有有效存储许可证(请勾选一个)< / p>

< table border =1cellpadding =0cellsapcing =0border-style =solidstyle = border-collapse:collapse>

< tr>

< th style =text-align:center;宽度:50px;> J< / th>

< th style =text-align:center;宽度:50px;> XIII< / th>

< th style =text-align:center;宽度:50px;> XV< / th>

< th style =text-align:center;宽度:50px;> XVII< / th>

< TH style =text-align:center;宽度:50px;>没有许可证< / TH>



< / tr>

< tr style =text-居中对齐;宽度:50px;>

< td>< input type =radioname =licformvalue =j>< / td>

< td>< input type =radioname =licformvalue =xiii>< / td>

< td>< input type =radio name =licformvalue =xv>< / td>

< td>< input type =radioname =licformvalue =xxvii> < / td>

< td>< input type =radioname =licformvalue =nolicense>< / td>< / tr>

< / table>


<p>i. Possess Valid Storage License(Please Tick One)</p>
<table border="1" cellpadding="0" cellsapcing="0" border-style="solid" style="border-collapse: collapse" >
<tr>
<th style="text-align: center; width: 50px;">J</th>
<th style="text-align: center; width: 50px;">XIII</th>
<th style="text-align: center; width: 50px;">XV</th>
<th style="text-align: center; width: 50px;">XVII</th>
<TH style="text-align: center; width: 50px;">NO LICENSES</TH>

</tr>
<tr style="text-align: center; width: 50px;">
<td><input type="radio" name="licform" value="j"></td>
<td><input type="radio" name="licform" value="xiii"></td>
<td><input type="radio" name="licform" value="xv"></td>
<td><input type="radio" name="licform" value="xxvii"></td>
<td><input type="radio" name="licform" value="nolicense"></td></tr>
</table>

推荐答案

(input [type ='radio'])。click(function(){

if(
("input[type='radio']").click(function(){
if(


(this).val()===yes)
(this).val() === "yes")


('#textbox1 ')。show();

else
('#textbox1').show();
else


这篇关于当我点击不同的单选按钮时,文本框隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆