Server side call from javascript in a loop

Hi,

I am calling a server side script from the client side. The server side script is executing.
If i use a for loop on the javascript and call the server side script, it is executing only once. It does not fire the second time.
I am not sure why it is not firing the second time.

Can anyone help?

Thanks
<script type="text/javascript">
    
function LoopThroughTable()
{

var rtarr= new Array();
var currentrt = new Array();
rtarr= document.getElementById("<%= rtInfo.ClientID %>").value.split(";");
for(var n=0; n < rtarr.length -1 ; n++)
{
var stime= document.getElementById("stime").value;
var etime = document.getElementById("etime").value;
currentrt= rtarr[n].split(",");
var rtid = currentrt[0];
PageMethods.PageMethodAutoAssign(rtid, stime, etime);
return false;
}

}

</script>

Open in new window

shahjagatAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dimmergeekCommented:
After you execute the line
rtarr= document.getElementById("<%= rtInfo.ClientID %>").value.split(";");

Open in new window


can you loop through the array and print the contents on the screen?
Maybe you only have one element in the array..?
0
dimmergeekCommented:
var splitMe = document.getElementById("<%= rtInfo.ClientID %>").value;
var rtarr= splitMe.split(";");
for(var n=0; n < rtarr.length -1 ; n++)
{
     document.write (rtarr[n] + "<br />");
}

Open in new window

0
shahjagatAuthor Commented:
dimmergreek,

rtarr has more than one element. it has 103
0
dimmergeekCommented:
Try removing the Return false;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shahjagatAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.