Jump to content

Php


mavis

Recommended Posts

Here is a quick and dirty example

<html>
<head>
<script type="text/javascript">

function setOtherInput(colorSelect)
{
   visibileState = (colorSelect.value==false) ? 'visible' : 'hidden';
   document.getElementById('color_input').style.visibility = visibileState;
}

</script>
</head>

<body>

Select a color:
<select name="color" id="color" onchange="setOtherInput(this);">
 <option value="red">Red</option>
 <option value="green">Green</option>
 <option value="blue">Blue</option>
 <option value="yello">Yellow</option>
 <option value="0">Other</option>
</select><br>
<div id="color_input" style="visibility:hidden">Other color: <input type="text" name="other_color" /></div>

</body>
</html>   

Link to comment
https://forums.phpfreaks.com/topic/271890-php/#findComment-1398909
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.