Java - Error trap if file does not exist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ska2000
    New Member
    • Oct 2011
    • 1

    Java - Error trap if file does not exist

    Hello,
    1st of all, I'm not a developer; so, I'll need things spelled out pretty clearly.

    I have a working javascript and form (see below).
    1. We will have documents scanned to PDF on the server.
    2. All documents will have a numerical filename that corresponds to a manifest (tracking) number. EX: 11111.pdf
    3. The user will type their maifest/tracking number into a box, click a button, then the PDF document will pop up in a new window.

    All of the stuff described above works. What I need is a way to test if the file exists, and display a "Come back later" message if it does not. The "come back later" message could be a static page sitting on the server if that is the easiest way?

    (begin currently working code)
    <html>
    <head>
    <script type='text/javascript'>

    function doit() {
    var x = document.getEle mentById('symtb ').value
    window.open('ht tp://Neo/'+x+'.pdf')
    }

    </script>

    <body>

    <TABLE SUMMARY="enter manifest number" BORDER="1" BGCOLOR="#33669 9">
    <TR>
    <TD>
    <center>
    <font color=white>
    <u>DESTRUCTIO N NOTICES</u><br>

    <input type='text' id='symtb' value='enter manifest #' size='15'>
    <br>
    <button onclick='doit() '>Get Destruction Notice</button>

    </center>
    </TD>
    </TR>
    </TABLE>
    </body>
    </head>
    </html>

    Thank you for your help,
    Tom Albert
  • rotaryfreak
    New Member
    • Oct 2008
    • 74

    #2
    I'm happy to see a non-developer trying to learn something about coding :). 2 things though, you should probably use the code tags (denoted by the # symbol) to help display the code properly, and you should probably post this topic within the javascript forums. Take a look at this web site, it may help you out



    best of luck

    Comment

    Working...