Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > Other Programming Languages
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 15th, 2006, 09:46 AM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default insert text into a text box by selecting an link

Hello,

Wondering if anyone can help.

I have been trying to insert text into a form text box by clicking on links using javascript, but have been having issues with this.

Currently i have 4 links with the values 1..4. When i click on one of the links, their value is entered into the text box in the form. Therefore selecting link 1 will insert the number 1 into the form.

Where i am having the problem is that if i want to insert multiple numbers into the textbox (i.e. 112114) the previous number is being overwritten by the new number selected by clicking on 1 of the other links

If anyone can help id be grateful

code as follows:

<script language='javascript' type="text/javascript">
<!-- Hide script from older browsers
        colorInfo = new Array
        colorInfo[1] = "1"
        colorInfo[2] = "2"
        colorInfo[3] = "3"
        colorInfo[4] = "4"

        function showInfo(thisColor) {
           document.frmColor.txtColor.value = colorInfo[thisColor]
        }
// End hiding script from older browsers -->
</script>

<form name="frmColor" action="/testingsurname_search.asp" method="GET" id="frmColor">
<input type="hidden" name="pagename" value="color_search">
<input name="txtColor" type="text" size="10" >
<input name="color" value="colour" type="submit">
          </form>

<a href="#" onClick="this.href='javascript:showInfo(1)';">1</a>
<a href="#" onClick="this.href='javascript:showInfo(2)'">2</a>
<a href="#" onClick="this.href='javascript:showInfo(3)'">3</a>
<a href="#" onClick="this.href='javascript:showInfo(4)'">4</a>

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing text in text box inside table Larry Landis Word VBA 0 December 27th, 2007 12:03 PM
Text Box .text Property Displays conflicting Valus JPOhlman Visual Basic 2005 Basics 3 August 23rd, 2006 02:39 PM
Can't set text property of dynamic text box sreerajrs ASP.NET 1.0 and 1.1 Professional 1 May 31st, 2006 09:39 PM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM
How to insert default value if text box is empty akc Javascript How-To 2 November 7th, 2003 11:55 AM



All times are GMT -4. The time now is 08:35 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.