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 the meaning of a persistent cookie?
What is str_replace()?
Why triggers are used in mysql?
When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?
Which of the delimiter is ASP style?
What are the variables in php?
What is the current stable version of php?
Write a program to get second highest number in an array using php?
How to find datatype of variable in php?
Tell me how can we check the value of a given variable is alphanumeric?
Why session timeout is important?
Could we start a variable with number like $4name?
What is Mcrypt used for?
How we load all classes that placed in different directory in one php file , means how to do auto load classes.
How error handling is being handled by php?