<!-- FUNCIONES DE JAVASCRIPT --> 

<script language="javascript"> 

function mostrar_campo() 

{ 

document.getElementById('texto').style.display=''; 

document.getElementById('insertar').style.display=''; 

} 

</script> 



<script language="javascript"> 

function ocultar_campo() 

{ 

document.getElementById('texto').style.display='none'; 

document.getElementById('insertar').style.display='none'; 

document.getElementById('ocultar').style.display='none'; 

} 

</script> 



<script type="text/javascript"> 

<!-- 

function insertOption(elm) 

{ 

var y=document.createElement('option'); 

y.text=elm; 

var x=document.getElementById("mySelect"); 

try 

{x.add(y,null); } 

catch(ex) 

{x.add(y); } 

} 

</script> 

<!-- FIN DE LAS FUNCIONES DE JAVASCRIPT --> 

<table width="684" border="0" cellspacing="0" cellpadding="0"> 

<tr> 

<td>&nbsp;</td> 

<td>&nbsp;</td> 

<td>&nbsp;</td> 

</tr> 

<tr> 

<td width="371">Seleccione la opcion:</td> 

<td width="34">&nbsp;</td> 

<td width="279">&nbsp;</td> 

</tr> 

<tr> 

<td> 

<form action="8-1.php" method="post"> 

<select name="select" id="mySelect"> 

<option>Opcion 1</option> 

<option>Opcion 2</option> 

<option>Opcion 3</option> 

<option>Opcion 4</option> 

</select> 

<input type="submit" name="Submit" value="Enviar" /> 

<input type="button" name="Accion" id="ocultar" onclick="ocultar_campo() || mostrar_campo()" value="Agregar" /> 

</form> 

</td> 

<td>&nbsp;</td> 

<td> 

<form> 

<input name="texto" type='text' id="texto" style="display:none" value='' /> 

<input name="button" type='button' id="insertar" style="display:none" onclick="insertOption(elements[0].value) || ocultar_campo()" value='Insertar' /> 

</form> 

</td> 

</tr> 

<tr> 

<td>&nbsp;</td> 

<td>&nbsp;</td> 

<td>&nbsp;</td> 

</tr> 

</table> 
