locked
HTA form help RRS feed

  • Question

  • Alright, to start I would like to say this is my first time building anything like this and I am all self taught, so be critical but please don't bash me. I work in IT and we have a in-house help desk that creates our tickets, the HTA I'm working on is to help them with creating tickets that all look the same instead of everyone being different. It is a form where they input the name, number, location and all other relevant data and I want a button at the bottom to copy it and put it into a specific format that they can then paste into the ticket and it should look something like this:

    Verified Contact Information
    -----------------------------
    Phone: 
    Bldg: 
    Room: 


    Computer Name
    -------------

    Problem
    -------

    Troubleshooting 
    ---------------

    I have the form built, and it all looks good but the button does not function. I thought of somehow using the submit function to copy to the clipboard but I am stumped. Any help would be appreciated.

    Friday, September 18, 2015 6:06 PM

Answers

All replies

  • Please post a short example HTA document that contains only the minimum amount of code to reproduce the problem.

    -- Bill Stewart [Bill_Stewart]

    Friday, September 18, 2015 6:45 PM
  • Yea I guess a clip would help.

    <script language="JavaScript">
     function ClipBoard() {
     Copied.execCommand("RemoveFormat");
     Copied.execCommand("Copy");
     }


    </script>
    </head>
    <body>
    <div class="header">
     <h1>
      Minimum Ticket Notes
     </h1>
     <br>
     <br>
    </div>

    <div class="leftcol" style="">
     
     <br>
     
    <h1>
      <b>**User Info**</b>
     <form>
     First name:<br>
     <input type="text" name="firstname">
     <br>
     Last name:<br>
     <input type="text" name="lastname">
     <br>
     Phone Number:<br>
     <input type="text" name="phone">
     <br>
     Building:<br>
     <input type="text" name="building">
     <br>
     Post/Room:<br>
     <input type="text" name="post">
     <br>
     Computer Name:<br>
     <input type="text" name="computername">
     <br>
     Description:<br>
     <textarea name="notes" rows="5" cols="30"></textarea>
     <br>
     Troubleshooting:<br>
     <textarea name="troubleshooting" rows="5" cols="30"></textarea>
     </form>
     </div>
    </h1> 
    <p>
     <button onclick="ClipBoard()"><b>Copy</b></button><br>
     <button style="width:15;height:15;margin-right: 10px;cursor: pointer" onclick="RESET_FIELD()"><b>Reset Field<br/></button>
    </p>


    </body>
    </html>

    I have tried a couple things I found online so the script probably doesn't mean anything, but this is the form. I was looking at using JavaScript but I have also tried a bit of VBscript. As I said before im self taught so im not set on one type yet.

    Friday, September 18, 2015 6:52 PM
  • Make sure that you search first before asking:

    http://www.google.com/search?&q=hta+copy+text+to+clipboard

    When I do that search, the first result is from this forum.


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Bill_Stewart Thursday, October 1, 2015 4:14 PM
    • Marked as answer by Yeliar Thursday, October 1, 2015 6:32 PM
    Friday, September 18, 2015 7:23 PM