Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) Dynamically copy fields?

  • Dynamically copy fields?

    Posted by Sqrdreams on February 25, 2007 at 5:21 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"*>
    <*/textarea*>

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

    Thanks,

    Sapphire Parker replied 17 years, 9 months ago 3 Members · 3 Replies
  • 3 Replies
  • Curtis Thompson

    February 25, 2007 at 4:19 pm

    hello…

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

    https://www.sitruc.com/cow/js_copy_fields.html

    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!

    sitruc

  • Sqrdreams

    March 16, 2007 at 10:16 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 incorrectly…it 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!

  • Sapphire Parker

    August 21, 2008 at 3:11 pm

    Check out this code:

    <HTML><HEAD>
    function fn_move_2_textarea()
    {
    document.getElementById(‘txt_textarea’).value = document.getElementById(‘txt_input’).value;
    document.getElementById(‘txt_input’).value = ”;
    }
    </script>
    </HEAD><BODY>
    <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>
    </form>
    </BODY>

    Cheers,

    SP
    https://www.videoediting-direct.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy