chris wrote:
i have a set od radio buttons what i wanty to do is when one particular
button is selected bring up an additional text box for additional
information
You should hide the input with script and not with static HTML/CSS as
otherwise the page is not functional if script is not enabled or supported:
<html lang="en">
<head>
<title>toggli ng the CSS display property</title>
<script type="text/javascript">
function hideElement (element) {
if (element.style) {
element.style.d isplay = 'none';
}
}
function showElement (element) {
if (element.style) {
element.style.d isplay = '';
}
}
</script>
</head>
<body>
<form name="formName" action="whateve r.php">
<input type="radio" name="radioName "
onclick="if (this.checked) {
showElement(thi s.form.elements .inputName);
}"
value="Kibology ">
<input type="radio" name="radioName "
onclick="if (this.checked) {
hideElement(thi s.form.elements .inputName);
}"
value="JavaScri pt">
<input type="text" name="inputName ">
</form>
<script type="text/javascript">
hideElement(doc ument.forms.for mName.elements. inputName);
</script>
</body>
</html>
That should make the page functional in any browser and allow the
desired effect in IE4+, Netscape 6/7, Mozilla, Opera 7 and other
browsers allowing to change the CSS display setting dynamically.
--
Martin Honnen
http://JavaScript.FAQTs.com/