Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation This array won't print, help!

    I have a .js file with the arrays and an html file for the web page. The arrays won't print. The idea is to have a check box with the statement next to it. I save the statements as arrays because the same statement might be used by many different pages.

    In the javascript file:
    //Conditions
    var condition= new Array();
    condition[0]="certain RADIO-ACTIVE RELEASE/HAZARD";
    condition[1]="certain BIOLOGICAL RELEASE / HAZARD";
    condition[2]="certain CHEMICAL OR SOLVENT HAZARD";
    condition[3] "certain TOXIC FUMES RELEASE/HAZARD";
    condition[4]="Personal injury, illness, or exposure";
    condition[5]="Multiple injuries, illnesses, or exposures";
    condition[6]="Experience irritation, coughing, burning eyes, difficulty breathing";

    //Security and Evacuation
    var security=new Array();
    security[0]= "Evacuate Immediate Vicinity";
    security[1]= "Evacuate Building";
    security[2]= "Evacuate Campus";
    security[3]= "Secure the immediate area";
    security[4]= "Secure the zone";
    security[5]= "Limit access to authorized personnel";
    security[6]= "Do not re-enter the area until advised by emergency personnel";


    In the html file:

    <html>
    <head>
    <script type="text/javascript" src="list.js"></script>
    </head>
    <body>
    <script type="text/javascript">
    document.write("<h1>Hazardous Material Response</h1>");
    document.write("<table>");
    document.write("<tr>");
    document.write("<td>");
    document.write("<input type=\"checkbox\" name=\"condition\" id=\"c1\">");
    document.write(condition[1]);
    document.write("</td>");
    document.write("<td>");
    document.write("</tr>");
    document.write("</table>");
    </script>
    </body>
    </html>

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Code:
    var condition= new Array();
    condition[0]="certain RADIO-ACTIVE RELEASE/HAZARD";
    condition[1]="certain BIOLOGICAL RELEASE / HAZARD";
    condition[2]="certain CHEMICAL OR SOLVENT HAZARD";
    condition[3]="certain TOXIC FUMES RELEASE/HAZARD";
    condition[4]="Personal injury, illness, or exposure";
    condition[5]="Multiple injuries, illnesses, or exposures";
    condition[6]="Experience irritation, coughing, burning eyes, difficulty breathing";
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    is that the only reason why it won't print?



    oye..

    thankyou!



  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •