Solved

IF ERROR FOUND IN THE WHILE LOOP HOW TO DISPLAY THE ERROR MESSAGE ON TOP THE LOOP

Posted on 2006-06-14
5
262 Views
Last Modified: 2010-05-18
IF ERROR FOUND IN THE WHILE LOOP HOW TO DISPLAY THE ERROR MESSAGE ON TOP THE LOOP
0
Comment
Question by:mayachoy
5 Comments
 
LVL 9

Expert Comment

by:matthew016
ID: 16908951
Display a test print inside of the loop, u can't go back on top of it
0
 
LVL 3

Expert Comment

by:Kanti
ID: 16910123
Once you get into the loop you cannot go on top. You can try something like the below
<HTML>
 <HEAD>
  <TITLE>Using the for Statement</TITLE>
 </HEAD>

 <BODY>
  <H1>Using the for Statement</H1>
  <%
    int loopIndex;

    for (loopIndex = 1; loopIndex <= 10; loopIndex++) {
      out.println("This is iteration number "   + loopIndex + "<BR>");
    }
  %>
 </BODY>
</HTML>
0
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 16911456
You can of course do:

<HTML>
 <HEAD>
  <TITLE>Using the for Statement</TITLE>
 </HEAD>

 <BODY>
  <div id="errors"></div>
  <H1>Using the for Statement</H1>
  <%
    int loopIndex;

    for (loopIndex = 1; loopIndex <= 10; loopIndex++) {
      out.println( "<script type=\"text/javascript\">document.getElementById( 'errors' ).innerHTML += 'This is iteration number' + loopIndex + '<BR>' ;" ) ;
    }
  %>
 </BODY>
</HTML>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
spring dependency injection using java config 2 91
AlarmClock Challenge 35 156
how to exclude a file using regex 5 123
jdbc error in jsp application 20 74
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question