Propiedad Disabled de JavaScript en Firefox y Safari

July 26th, 2008 by 0w3w

En mis diversas pruebas me he dado cuenta que la propiedad disabled de JavaScript no servia en exploradores diferentes a IE, así que me dí a la tarea de hacerlo funcionar.

Encontre que para hacer servir esta propiedad necesitas usar getElementById(). He aqui el código que funciona en mozilla y safari:

<script type=”text/javascript”>
function dis(){
document.getElementById(’hola’).disabled=true;
}
function ene(){
document.getElementById(’hola’).disabled=false;
}
</script>
<form method=”post” target=”_self” enctype=”multipart/form-data”>
<input type=”button” onclick=”dis()” value=”DISABLED”>
<input type=”button” onclick=”ene()” value=”ENABLED”>
<input type=”text” value=”hola” id=”hola”>
</form>

Posted in Programación

Autobombeame Digg Technorati Meneame Webeame Enchilame Del.icio.us Google Bookmarks Blinklist Barrapunto Fresqui BlogMemes NeoDiario MisterWong

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.