Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,256
Total Threads: 106,575
Total Posts: 592,698
There are 88 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Click to add to text box script

Thread title: Click to add to text box script
Reply    
    Thread tools Search this thread Display Modes  
05-26-2011, 03:03 PM
#1
scrappy is offline scrappy
scrappy's Avatar
Status: Member
Join date: Aug 2006
Location: Newcastle upon Tyne
Expertise:
Software:
 
Posts: 172
iTrader: 1 / 100%
 

scrappy is on a distinguished road

Send a message via MSN to scrappy

  Old  Click to add to text box script

Please forgive me for the 'not very descriptive' title. I am really stuck for this one.

I am looking to create a script that displays a list of options under some headers. When you click on one of the options (simple text) they would copy into a text box (each on a new row) which could then be copied to clipboard.

I have found something my work is using, but I cannot seem to work out the scripting properly and was hoping that it would be possible to create something using Javascript.

I have been hunting online for this for around an hour now and I can not find what I am looking for.

Does anyone have any ideas on this?

Reply With Quote
05-26-2011, 04:32 PM
#2
scrappy is offline scrappy
scrappy's Avatar
Status: Member
Join date: Aug 2006
Location: Newcastle upon Tyne
Expertise:
Software:
 
Posts: 172
iTrader: 1 / 100%
 

scrappy is on a distinguished road

Send a message via MSN to scrappy

  Old

I finally found something.

I use this script:

HTML Code:
<SCRIPT>
flag=0
 
function addTex(let)
{
var story = document.tex.texarea.value
if(let=="BACK"){
story=story.substring(0, story.length-1)
document.tex.texarea.value=story
document.tex.texarea.focus()
**
 
else if(flag==1)
{
story+=let.toUpperCase()
flag=0
document.tex.texarea.value=story
document.tex.texarea.focus()
**
else
{
story+=let
flag=0
document.tex.texarea.value=story
document.tex.texarea.focus()
**
**
function capIt()
{
flag=1
**
</SCRIPT>
As well as this one:

HTML Code:
<a href="javascript:addTex(' -   Test Text 2  \n')" CLASS="B10">      Test Text 2  </a>
This adds the text into a form:

HTML Code:
<TEXTAREA NAME="texarea" COLS="50" ROWS="10"onDblClick="document.getElementById('texarea').innerText=''" oncontextmenu="javascript:HighlightAll('tex.texarea')" VALUE="Clipboard"></TEXTAREA></td>
</tr>
<tr>
<td ALIGN="Center" Height="30"><INPUT NAME="copy" TYPE="button" onClick="javascript:HighlightAll('tex.texarea')" VALUE="Clipboard"></td>
</tr>
</table>
</FORM>

This seems to function correctly. A little bit of styling and I should be ok.

Only problem is, is that when I put more than 1 onto a page, they don't work.

08-07-2011, 03:39 PM
#3
Webgirl is offline Webgirl
Status: I'm new around here
Join date: Feb 2011
Location:
Expertise:
Software:
 
Posts: 18
iTrader: 0 / 0%
 

Webgirl is on a distinguished road

  Old

Im still trying to figure out what you really want but I have no clue - I had a look at your code and found this CLASS="B10" you are referencing to this CLASS="B10" but where is this CLASS. Do you get what I mean?

Reply    


Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed