Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if not defined 2

Status
Not open for further replies.

44nato44

Programmer
Dec 12, 2008
115
NL
if not defined

Hi

I have the below code, which does not work. I am not able to get into my if statement

I have tried :

If (myBox[taeller])
If (myBox[taeller]=="true")
If (myBox[taeller]=='true')
If (myBox[taeller]= myBox[taeller])
If (myBox[taeller]== myBox[taeller])

None of the above are working, I know a bit of asp coding so I thought I could understand java script, but it does not look like it.

I hope there is somebody who can help

Code :

function droppedOnDropBox(evt) {
var dropbox = document.getElementById("dropbox");
var dropbox2 = document.getElementById("dropbox2");
var x = getX(dropbox);
var y = getY(dropbox);
var x2 = getX(dropbox2);
var y2 = getY(dropbox2);
var width = getWidth(dropbox);
var height = getHeight(dropbox);
var width2 = getWidth(dropbox2);
var height2 = getHeight(dropbox2);
var Box1, Box2;
var taeller;
var myBox=new Array();


Box1 = evt.x > x &&
evt.y > y &&
evt.x < x + width &&
evt.y < y + height;

Box2 = evt.x > x2 &&
evt.y > y2 &&
evt.x < x2 + width2 &&
evt.y < y2 + height2;

myBox[0] = Box1;
myBox[1] = Box2;

for (taeller in myBox)
{
alert(myBox[taeller]);

If (myBox[taeller])
{
/* Det er her jeg ikke kan komme ind */
alert("If Bingo");
}

/* return myBox[taeller]; */
}
}
 
Thanks guys :)

That did the trick

being use to asp must be a curse
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top