Jump to content

Why this dont work on firefox or IE?


MaG_MaN

Recommended Posts

why this simple code only works on chrome??

function mostrarOcultar(obj) {
  document.getElementById('seguro').style.visibility = (obj.checked) ? 'hidden' : 'visible';
}
this the php:
<table width="100%" border="1" id="seguro" style="visibility:visible">
    <tr>
        <td bgcolor="#B4ED89" class="Estilo3"><?php echo "Cantidad Asegurada Bs" ?></td>
        <td width="47%"><input name="asegu" type="text" id="asegu" size="39"  onkeypress="return NumCheck(event,this)"  onpaste="return false"/></td>
    <tr>
</table>

only work on chrome and perfectly

 
Link to comment
https://forums.phpfreaks.com/topic/289012-why-this-dont-work-on-firefox-or-ie/
Share on other sites

You have not shown how the mostrarOcultar() function called? I assume it is called with a checkbox onclick event? which you'd toogle the checkbox to show/hide the table?

 

I testing the code like this

<input type="checkbox" onclick="mostrarOcultar(this)">

<table width="100%" border="1" id="seguro" style="visibility:visible">
    <tr>
        <td bgcolor="#B4ED89" class="Estilo3"><?php echo "Cantidad Asegurada Bs" ?></td>
        <td width="47%"><input name="asegu" type="text" id="asegu" size="39"  onkeypress="return NumCheck(event,this)"  onpaste="return false"/></td>
    <tr>
</table>

<script type="text/javascript">
function mostrarOcultar(obj) {
  document.getElementById('seguro').style.visibility = (obj.checked) ? 'hidden' : 'visible';
}
</script>

Works fine in IE11 and FF28 on Win7

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.