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>&nbsp;</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


Please Help Members By Posting Answers For Below Questions

How can we create a database using php?

671


How does php session work?

599


What is echo and print in php?

578


What is a base url?

587


How to return a value back to the function caller?

636






How to find the index of an element in an array php?

599


What is a query in a database?

639


how retrive the video file in php using video tag

1447


What is a path Traversal?

624


Who is the father or inventor of php?

660


How can we automatically escape incoming data?

606


Should I learn php before wordpress?

565


Can we run php on tomcat server?

652


How do you pass a variable by value in php?

622


How to open a file for writing?

644