Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text link filling in text and check boxes? 1

Status
Not open for further replies.

TFfan

Programmer
Jan 18, 2002
192
CA
Is it possible to have a series normal text links submit information forms?

Say you ask a question: What have you eaten today?

Banana ________
Pear | text box |
Apple -----------

When the user clicks on one of the options the text box gets filled in with the appropriate value. That value can then be altered manually by the user. This last part seems to me to be the trickiest. There would be several of these on a page.
 
I'm sure you can modify this to better fit your needs, but this is something I came up with quickly. Hopefully it'll give you an idea of what can be done...


<html>
<body>
<script language=&quot;javascript&quot;>
function addItem(Name)
{
document.getElementById('TxtBox').value = Name;
}
</script>
<p id=&quot;Apple&quot; onclick=&quot;addItem(this.id)&quot;>Apple</p>
<p id=&quot;Pear&quot; onclick=&quot;addItem(this.id)&quot;>Pear</p>
<p id=&quot;Orange&quot; onclick=&quot;addItem(this.id)&quot;>Orange</p>
<form method=&quot;POST&quot; action=&quot;--WEBBOT-SELF--&quot;>
<!--webbot bot=&quot;SaveResults&quot; U-File=&quot;fpweb:///_private/form_results.txt&quot;
S-Format=&quot;TEXT/CSV&quot; S-Label-Fields=&quot;TRUE&quot; -->
<p><input type=&quot;text&quot; name=&quot;TxtBox&quot; id=&quot;TxtBox&quot; size=&quot;20&quot;><input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;></p>
</form>
<p> </p>

</body>

</html>


Good luck.
 
Brilliant. If I could give you two stars i would. You went out of your way. I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top