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

    Need Simple Script.

    I'm, looking for a simple script to help me generate Trouble tickets.

    Basically, sevral links, you click on the link, and it inserts a value into a textbox. Click another link, inserts another value into the textbox.

    If anyone knows if this script exists somewhere, please let me know.... I've been looking for the last six hours.

    Tia.

    jimmy

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A simple example:

    Code:
    MY PROBLEMS ARE:
    <div>
    Height: 
    <a href="#" onclick="document.forms[0].height.value=this.innerHTML">Too Tall</a> /
    <a href="#" onclick="document.forms[0].height.value=this.innerHTML">Too Short</a><br>
    Weight: 
    <a href="#" onclick="document.forms[0].weight.value=this.innerHTML">Too Fat</a> /
    <a href="#" onclick="document.forms[0].weight.value=this.innerHTML">Too Skinny</a><br>
    </div>
    
    <form>
    Height: <input type="text" name="height"><br>
    Weight: <input type="text" name="weight"><br>
    </form>

  • #3
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply, now if only I could get both variables in the same field or box. :-)

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <script type="text/javascript">
     <!--//
      function displayProblem(which){
        document.forms[0].problem.value = which.innerHTML;
      }
     //-->
    </script>
    </head>
    
    <body>
    MY PROBLEMS IS:
    <div>
    Height: 
    <a href="#" onclick="displayProblem(this)">Too Tall</a> /
    <a href="#" onclick="displayProblem(this)">Too Short</a><br>
    Weight: 
    <a href="#" onclick="displayProblem(this)">Too Fat</a> /
    <a href="#" onclick="displayProblem(this)">Too Skinny</a><br>
    </div>
    
    <form>
    Problem: <input type="text" name="problem">
    </form>


  •  

    Posting Permissions

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