javascript ?

hey guys my second prob i bet this 1 is even simpler :D but here it is:<br />
<br />
<script language="JavaScript"><br />
<!--<br />
var isIE = document.all?true:false;<br />
var isNS = document.layers?true:false;<br />
function onlyDigits(e) {<br />
var keycode = event.keyCode<br />
var realkey = String.fromCharCode(event.keyCode)<br />
var myname = new Array(7)<br />
myname[0]='Bob'<br />
myname[1]='bob'<br />
myname[2]='bOb'<br />
myname[3]='BOB'<br />
myname[4]='boB'<br />
myname[5]='bOB'<br />
myname[6]='BOb'<br />
document.all.kc.value=keycode;<br />
document.all.rk.value+=realkey;<br />
if (document.all.rk.value == "abcdefghijklmnopqrstuvwxyz") {<br />
alert('You just typed the alphabet!!')<br />
}<br />
if (document.all.rk.value == myname[0] || myname[1]) {<br />
alert('You just typed my name!!')<br />
}<br />
var _ret = true;<br />
if (isIE) {<br />
if (window.event.keyCode < 46 || window.event.keyCode > 57) {<br />
window.event.keyCode = 0;<br />
_ret = false;<br />
}<br />
}<br />
if (isNS) {<br />
if (e.which < 46 || e.which > 57) {<br />
e.which = 0;<br />
_ret = false;<br />
}<br />
}<br />
return (_ret); <br />
}<br />
function keyDown2() {<br />
var realkey2 = String.fromCharCode(document.all.kc2.value)<br />
document.all.rk2.value=realkey2;<br />
}<br />
//--><br />
</SCRIPT><br />
<br />
thats the script my problm is getting the if statement to have two variables where either 1 can be tru for the script to be executed.. whatever that's called lol<br />
<br />
if (document.all.rk.value == myname[0] || myname[1])<br />
<br />
i've seen it like that before, working, but it doesnt seem to work w/ me :confused: TIA<br />
<br />
bobby<!--content-->It should be either<br />
if(document.all.rk.value == (myname[0] || myname[1]))<br />
<br />
or<br />
if(document.all.rk.value == myname[0] || document.all.rk.value == myname[1])<br />
<br />
(whereof solution 1 is easier)<!--content-->the first way didnt work but the second 1 did :confused: its longer but o well.. it works thx<!--content-->The first one works for me. But use alternative #2 then.<!--content-->
 
Back
Top