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
How can we create a database using php?
How does php session work?
What is echo and print in php?
What is a base url?
How to return a value back to the function caller?
How to find the index of an element in an array php?
What is a query in a database?
how retrive the video file in php using video tag
What is a path Traversal?
Who is the father or inventor of php?
How can we automatically escape incoming data?
Should I learn php before wordpress?
Can we run php on tomcat server?
How do you pass a variable by value in php?
How to open a file for writing?