FORUMS: list search recent posts

Dynamically copy fields?

COW Forums : Web Design

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dynamically copy fields?
on Feb 25, 2007 at 5:21:04 am

Hello all,

I've been looking all over for the answer to this question so I really do hope someone can please help me out. I just need a simple example of how to dynamically copy inputed values from a textField into a textArea by clicking a button. Someone suggested PHP and another suggested javascript. What I'm looking to do is create a small .css generator for my clients to use. This is the HTML I have so far. I placed *'s in it as I don't know how to keep code from graphically displaying:

<*input name="color" type="text" size="6"*>
<*input value="Create Code" type="button"*>
<*textarea name="output" cols="50" rows="10"*>

If someone can give me a hand on this, or point me in the right direction, it will be very greatly appreciated.


Return to posts index

Curtis Thompson
Re: Dynamically copy fields?
on Feb 25, 2007 at 4:19:09 pm


ya - javascript is the tool that you need - i wrote a simple example and put it on my site for you:

you can get a lot fancier, but that should be the general concept you were looking for, yes?

lemme know if not or if you have other questions!


Return to posts index

Re: Dynamically copy fields?
on Mar 16, 2007 at 10:16:18 pm

I'm so sorry it's taken me so long to get back to you!! Life has become kind of hectic these past few weeks and I completely forgot about this post!! If Creative Cow has some way of sending me an email when someone responds, I sure do need to find it.

I tried JavaScript and it's is just way too confusing for me to learn at the moment. Hahaha. I did get this to work in php for the most part. Someone can input #FFFFFF into a text feild, hit the 'Submit' button and then receive the output code >color=#FFFFFF> to copy.

However, when I try to place the output code into the box, the output code tends to come out gets partially translated.

If I don't figure it out, I think I'll just get rid of the text box altogether.

Thank you so much for your help though Curtis!

Return to posts index

Sapphire Parker
Re: Dynamically copy fields?
on Aug 21, 2008 at 3:11:59 pm

Check out this code:

function fn_move_2_textarea()
document.getElementById('txt_textarea').value = document.getElementById('txt_input').value;
document.getElementById('txt_input').value = '';
<form name="frm_test" id="frm_test" method="post">
<input name="color" type="text" size="6" id="txt_input" name="txt_input">
<input value="Create Code" type="button" onClick="javascript:fn_move_2_textarea();">
<textarea name="output" cols="50" rows="10" id="txt_textarea" name="txt_textarea"></textarea>



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved