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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Increasing a number by 1 on page load.

    I'm not that advanced with my Java, so I need some assistance.

    I'm creating an online form for problem reporting and I need to have a new job number (increases by one) everytime an employee loads the site.

    It's not as easy as creating a hit counter, as I need it to appear in a textarea so that the number is posted with the rest of the information.

    If anyone can assist, this would be excellent. I've included my current code below so you can see what direction I'm heading. If you have any other suggestions, let me know!

    Thanks, Weez

    <html>
    <head>
    <title>IT Problem Report Form</title>
    </head>

    <body>

    <!---TABLE---!>

    <table width="1023" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="205" height="1063"></td>
    <td width="663"><form action="mailto: ..." method="post" enctype="text/plain" name="ProblemReport" id="ProblemReport">

    <!---FORM---!>

    <pre><p><font face = "arial" size = "6"><b><i>IT Problem Reporting Form</b></i></font><font face = "arial">

    Date (dd/mm): <input name="Date " type="text" id="Date" value="" size="5" maxlength="5"><br>
    First Name: <input name="FName " type="text" id="FName" size="20" maxlength="20"><br>
    Surname: <input name="SName " type="text" id="SName" size="20" maxlength="20"><br>
    Username: <input name="UName " type="text" id="UName" size="20" maxlength="20"><br>
    School: <select name="Campus " id="Campus"><option value=" S">Senior</option><option value=" M">Middle</option><option value=" J">Junior</option><option value=" B">Bellarine</option><br><br>
    </select>

    <hr>

    Computer location (if applicable): <input name="Location " type="text" id="Location" size="59" maxlength="50"><br>
    Have you attempted resetting your computer? <label><input type="radio" name="Reset " value=" Y">Yes</label> <label><input type="radio" name="Reset" value=" N">No</label><br>
    Have you checked cables to see if connected properly? <label><input type="radio" name="Cables " value=" Y">Yes</label> <label><input type="radio" name="Cables" value=" N">No</label>

    Problem description
    <textarea name="Problem " cols="80" rows="5" id="Problem"></textarea><br>
    Error message description
    <textarea name="Errors " cols="80" rows="2" id="Errors"></textarea><br>
    When did you discover the problem?
    <textarea name="Discovered " cols="80" rows="5" id="Discovered"></textarea><br>
    Steps attempted to fix problem
    <textarea name="Attempted " cols="80" rows="5" id="Attempted"></textarea><br>
    To assist us with prioritising, how urgent is this problem?<br>
    <input type="radio" name="Urgency " value=" 1">Extremely
    <input type="radio" name="Urgency " value=" 2">Fairly
    <input type="radio" name="Urgency " value=" 3">When You Have Time<br>

    <hr>

    <br><input type="submit" name="Submit " value="Submit"> <input name="Reset" type="reset" id="Reset" value="Reset"><br>
    Thankyou for taking the time to complete this form.
    We will assess your problem as soon as possible.</p>
    - IT Department -
    </pre>

    </p>
    </form>

    <!---FORM END---!>

    </td>
    <td width="155"></td>
    </tr>
    </table>

    <!---TABLE END---!>

    </body>
    </html>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    First of all, this forum is about JavaScript, not Java, which is a completely different language in spite of the confusingly similar name.

    Secondly, JavaScript has no capability to read from or write to a file,
    so you will need a server-side language such as PHP or PERL to keep track
    of the job number and increment it by one each time.

    It is possible to create a unique (but not sequential) job number based on the time of day, at its crudest something like 1155231003, i.e submitted at 11.55.23 on 10th March.


  •  

    Posting Permissions

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