
30/03/2010, 16:17
|
 | | | Fecha de Ingreso: noviembre-2007 Ubicación: Merida , Venezuela
Mensajes: 1.066
Antigüedad: 17 años, 4 meses Puntos: 25 | |
Respuesta: Bloquear campos en un formulario <HTML>
< HEAD>
<SCRIPT LANGUAGE="JavaScript">
function Disab(val) {
frm=document.forms[0]
if(val=="enabl")
{frm.Button1.disabled=false;frm.Button2.disabled=f alse}
if(val=="buttn1")
{frm.Button1.disabled=true;frm.Button2.disabled=fa lse}
if(val=="buttn2")
{frm.Button1.disabled=false;frm.Button2.disabled=t rue}
if(val=="disabl")
{frm.Button1.disabled=true;frm.Button2.disabled=tr ue}
}
</SCRIPT>
</HEAD>
<BODY TEXT="000000" BGCOLOR="FFFFFF">
<form>
<div align="center">
<select name="select" onChange="Disab(this.value)">
<option value="enabl">Enable All Buttons</option>
<option value="buttn1">Disable Button 1</option>
<option value="buttn2">Disable Button 2</option>
<option value="disabl">Disable All Buttons</option>
</select>
</div>
<p align="center">
<input type=button onClick="alert('Button 1 pressed!')" value="Button 1" name="Button1">
<input type=button onClick="alert('Button 2 pressed!')" value="Button 2" name="Button2">
</form>
</BODY>
</HTML>
__________________ O nos hacemos miserables o nos hacemos fuertes , la cantidad de trabajo es la misma. |