Oke 0 Share Posted July 1, 2005 Helló! Ebben mi a hiba? <script language="JavaScript"> function valami() { if (document.adatlap.lista[0].checked) | (document.adatlap.lista[1].checked) | (document.adatlap.lista[2].checked) | (document.adatlap.lista[3].checked) { document.adatlap.submit(); } else { alert('Valami'); } </script> Link to comment Share on other sites More sharing options...
google 0 Share Posted July 1, 2005 Az operátor itt OR akar lenni? Az nem két | -jelbõl áll? Link to comment Share on other sites More sharing options...
Oke 0 Author Share Posted July 1, 2005 Köszi. Így sem jó. (a | jel OR akar lenni) ír: Link to comment Share on other sites More sharing options...
google 0 Share Posted July 1, 2005 Nem hiszem, hogy ez a sok or szerencsés-e egymás mellett. Inkább switch-ben kellene gondolkodni. De javascriptben nem tudom a pontos szintaktikát, de próbálok keresni egyet. Link to comment Share on other sites More sharing options...
google 0 Share Posted July 1, 2005 <script language="JavaScript"> function valami() { switch (document.adatlap) { case lista[0].checked: document.adatlap.submit(); break; case lista[1].cheched: document.adatlap.submit(); break; case lista[2].checked: document.adatlap.submit(); break; case lista[3].cheched: document.adatlap.submit(); break; default: alert('Valami'); } } </script> Nem biztos, hogy így mûködni fog, de ez a szintaktika. Link to comment Share on other sites More sharing options...
ocsi 0 Share Posted July 1, 2005 Javascriptben annyira nem vagyok jártas, de nem értem miért lenne baj a sok || egymás mellet?( ha jól van írva akkor szerintem mûködnie kéne) Php-ban legalábbis mûködne! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now