Solved

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

Posted on 2006-06-14
5
258 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to group array of objects ? 5 60
rebasing and merging used in SCM 1 66
dateFashion java challenge 9 132
struts exact match support 3 51
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

939 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now