Javascript issue in JSP

I have a submit button in my JSP. I called two javascript functions like onclick="call1();call2();". But it looks call1() function works and not call2(). How do I make both fns to work? Thanks.
[200 byte] By [skp71a] at [2007-10-3 9:38:04]
# 1
Call the function call2() inside call1() as below ..function call1(){ //blah ...blah ...blah ... call2();}-Rohit
RohitKumara at 2007-7-15 4:53:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
that is nonsense, the wat the op does it should also work.You say that call2() doesn't work. Perhaps it does work and your expectations are just wrong? If not, perhaps there is a javascript error? Try running the page using firefox and check the javascript console.
gimbal2a at 2007-7-15 4:53:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
yeah i go for javascript error.. the second function is called but not all the lines where executed.. you can pu alerts for checking
jgalacambraa at 2007-7-15 4:53:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
There is js error and also I tried alert in the 2nd fn. It's not even going inside the 2nd fn. Any idea? Thanks for the replys.I can call the 2nd fn inside first one, but that may change some other functionality.
skp71a at 2007-7-15 4:53:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
There are a few possibilities:-You miss a semicolon on line 13...-You are really an unlucky guy-Your browser wants to see you cry(Remember never give your non-working code when asking for help)
alban.maillerea at 2007-7-15 4:53:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Stop babbling Mr. alban.maillere. If you don't want to help me, that's fine thanks.
skp71a at 2007-7-15 4:53:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

If you can post the source of these two calls, it would help us to help you. Otherwise, you will just get sarcastic remarks like the previous.

Pepper alert() messages through call1() function, and see at what point it stops running.

eg

onclick="call1();alert('success1'); call2();".

evnafetsa at 2007-7-15 4:53:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

I'm not sure whether this will help or not.

I encounter this problem some time ago.

Lets say u have 2 javascript function call1() and call2().. both returns a boolean upon exit. If you do 'onclick="return call1(); call2()"', call2() will never get executed cause u already return a control to the jsp/browser.

Sorry, don't think can help much cause dunno wat's in your code. So just guessing.. Hope it helps..

-TiKuS-a at 2007-7-15 4:53:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9

Here's the source, basically populating values for hidden variables.

function getMktNames() {

//call this function while submiting form...

//array not holding values, when come back from confirmation and go again to confirm screen

var mkts = "";

for (var ctr = 0;ctr < document.getElementById('mrktId').options.length ; ctr++ ) {

if (document.getElementById('mrktId').options[ctr].selected){

//do not add , if the value is empty

if (mkts != "") {

mkts = mkts + ",";

}

mkts = mkts + document.getElementById('mrktId').options[ctr].text;

}

}

document.forms[0].mktsSelected.value = mkts;

}

function getMktShrNames() {

var mkts = "";

for (var ctr = 0;ctr < document.getElementById('mrktIdShr').options.length ; ctr++ ) {

if (document.getElementById('mrktIdShr').options[ctr].selected){

//do not add , if the value is empty

if (mkts != "") {

mkts = mkts + ",";

}

mkts = mkts + document.getElementById('mrktIdShr').options[ctr].text;

}

}

document.forms[0].mktsSelectedShr.value = mkts;

}

skp71a at 2007-7-15 4:53:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
<babbling>nothing wrong here (excepted poor code design)perhaps could you post all the html code?</babbling>
alban.maillerea at 2007-7-15 4:53:49 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...