Solved

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSP Popup page 2 116
org.apache.jasper.JasperException: using jstl in jsp embedded jetty 13 614
print map entry 34 69
ejb on wildfly 5 20
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
February 24, 2017 — On February 23, Travis Ormandy, a vulnerability researcher at Google, reported on Twitter (https://twitter.com/taviso/status/834900838837411840) that massive stores of data have been leaked by CloudFlare, a company that provide…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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