Solved

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

Posted on 2006-06-14
5
256 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
Comment Utility
Display a test print inside of the loop, u can't go back on top of it
0
 
LVL 3

Expert Comment

by:Kanti
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

12 Experts available now in Live!

Get 1:1 Help Now