Jump to content

Recommended Posts

Posted

alo a todos

eu tenho este codigo mas ele nao ta funcionado como eu quero

e o seguinte: nesse dropdwon quando for selecionado o elemento 19 ele nao deve por em disable mas do contrario sim, mas quando seleciono o elemento 19 depois de ter selecionado um elemento qualquer ele nao em enable como deveria ser...

<select name=Servico size="1" height="1" style="WIDTH: 400px" onchange="if(this.selectedIndex == 19){

document.getElementById('Destinatario').enabled = 'enabled'}

else{document.getElementById('Destinatario').disabled = 'disabled'}"><OPTION selected></OPTION>

<?php

require("conect.php");

$sql="select servico from SERVICOS";

$result=mysql_query($sql);

while($registo=mysql_fetch_array($result)){

$Tipo=$registo['servico'];

echo '<OPTION>'.$Tipo.'</OPTION>';

}

?>

</select>

craziness it's to do the same thing over and over again expecting a different result

  • 2 weeks later...
Posted

if(this.selectedIndex == 19)

document.getElementById('Destinatario').disabled = false;

else document.getElementById('Destinatario').disabled = true;

Deve funcionar.

Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.