...

View Full Version : Need Simple Script.



thecount
06-19-2004, 02:06 PM
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

Willy Duitt
06-19-2004, 03:23 PM
A simple example:


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>

thecount
06-20-2004, 07:03 AM
thanks for the reply, now if only I could get both variables in the same field or box. :-)

Willy Duitt
06-20-2004, 08:39 AM
<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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum