Click to See Complete Forum and Search --> : running two scrips on form submition


webtekie
11-10-2003, 01:16 PM
Hi guys,

I am trying to run two JavaScripts when a form is submited, but no luck. One of them is always not running. What am I doing wrong?

out.println("<form name=\"files\" action=\"buildhs.jsp\" onsubmit=\"return checkPos(this); checkImageTextInput(this);\">");


thanks,
webtekie

Phil Karras
11-10-2003, 01:29 PM
Try either this:

onsubmit=\"checkImageTextInput(this); return checkPos(this);\">");

// or this:

onsubmit=\"return DoMe();"

function DoMe() {
checkImageTextInput(this);
return checkPos(this);
}


Notice the order of the functions running in this case IS important!

webtekie
11-10-2003, 01:34 PM
thanks Phil, first one worked! :D