I have two radio button, i click one radio button display
one dropdown box, one text field. and then click another
radio button display one text field.so any one give me good
idea plz.....i used <div id="" style=display:none> but not
work..
Answer Posted / monika
Please try following:
<html>
<head>
<script language='javascript'>
function display(){
if(document.frmRadio.selType[0].checked){
document.getElementById('div1').style.display
= 'block';
document.getElementById('div2').style.display
= 'block' ;
}
else{
document.getElementById('div2').style.display
= 'none';
document.getElementById('div1').style.display
= 'block';
}
}
</script>
</head>
<body>
<form name='frmRadio'>
<tr><td><input type=radio name='selType' onclick='display
()'> Display dropdown & textbox</td></tr>
<tr><td><input type=radio name='selType' onclick='display
()'> Display Textbox Only</td></tr>
<tr height='30'><td> </td></tr>
<div id='div1' style=display:none>
<tr>
<td><input type='text' name='txtName'></td>
</tr>
</div>
<div id='div2' style=display:none>
<tr>
<td>
<select name='selOption'>
<option value='A'>A</option>
<option value='B'>B</option>
</select>
</td>
</tr>
</div>
</form>
</body>
</html>
| Is This Answer Correct ? | 209 Yes | 34 No |
Post New Answer View All Answers
What is php rest api?
Is empty check in php?
What is the difference between array_map () and array_shift ()?
How is the comparison of objects done in php?
What is encapsulation in php with example?
What is php and its features?
Explain me what are the 3 scope levels available in php and how would you define them?
What is warning – “cannot modify header information – headers already sent”?
What is rest api in php?
What is prepare in php?
How can I use single quotes in single quotes in php?
Write a program in php to reverse a number?
How to execute an sql query?
How can you pass a variable by reference?
How to create database connection and query in php?