PDA

View Full Version : return and functions


swtrans
02-27-2006, 02:58 PM
http://oberman.info/test/stuck.htm

I'm having a problem. I was able to get the edit working fine. I was able to get it to hide the current div and go to a different div. When I combine the two, the edit works but I cannot go to the different div.

I'm thinking something is missing here ????

function goto_testDiv()
{
return formCheck(this);
document.getElementById('startDiv').style.display = 'none';
document.getElementById('testDiv').style.display = 'block';
}

Thanks.

Nischumacher
02-27-2006, 03:07 PM
function goto_testDiv()
{
document.getElementById('startDiv').style.display = 'none';
document.getElementById('testDiv').style.display = 'block';
return formCheck(this);
}
oNCe You return SoMeTHiNG iN a FuNCTioN... THe CoDeS aFTeR iT aRe NoR PeRFoRMeD...

swtrans
02-27-2006, 03:18 PM
There is so much to learn. Thanks for your help.

http://oberman.info/test/stuck2.htm

Now what happens is I move to that div first. I tried getting rid of the word return also and just running the function.

Nischumacher
02-27-2006, 03:31 PM
TRY THiS...
function goto_testDiv()
{ if (formCheck(this))
{ document.getElementById('startDiv').style.display = 'none';
document.getElementById('testDiv').style.display = 'block';
}
}
aLSo aDD a return true iN YouR formCheck FuNCTioN...
function formCheck(formobj)
{
...
return true;
}

swtrans
02-27-2006, 03:54 PM
Works like a charm and makes sense. Thanks again.