Dyanmically Updating Code Inside Text Area Help

Discussion in 'HTML & Website Design' started by wd_2k6, Mar 1, 2008.

  1. #1
    Hi,
    I have a textbox which contains code where the user can embed the youtube video onto their own page..
    However i want to have options where the user can customize vid, choose colour, border and autoplay option and the code in the textbox will automatically be updated.

    The question is:

    how do i make my text appear after the youtube url rather than at the end of the whole code inside the textbox?

    I know that
    onclick="this.form.text1.value=this.form.text1.value+'\n'+this.form.xyzvalue"
    Code (markup):
    will add my xyz value at the end of the textbox but i need it to appear directly after the youtube url. (which will be defined in php if that helps in anyway)

    Many Thanks in advance.
     
    wd_2k6, Mar 1, 2008 IP
  2. hostydotnet

    hostydotnet Active Member

    Messages:
    355
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #2
    hi,

    since you have given next to no clue on how to solve your problem this will probably be the best answer you get.

    you will probably have to do some javascript string manipulations just like you are doing in your code sample here and insert it where you want it....maybe by chopping your existing string into 2 vars. then re-connecting them like finalvar = string1+yourtextvar+string2.

    unfortunely i can't help you with exact code or even quality psuedo because you have given no url and not enough details to really even give you a psuedo code :rolleyes:

    kevin
     
    hostydotnet, Mar 2, 2008 IP
  3. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #3
    OK i am sorry i actually edited my post to try and summarise my problem as much as possible. OK here is what i need:
    This is the basic Youtube Code which will be default in the textarea:
    <embed src=[B]"YOUTUBEURL"[/B] type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
    Code (markup):
    OK the YOUTUBEURL will be defined with something like this
    <?php echo $ytube; ?>
    Code (markup):
    What i need is when a user clicks a colour the following code will be added directly after the YOUTUBEURL in the textbox.
    rel=0&color1=0x3a3a3a&color2=0x999999"
    Code (markup):
    There will be various colour codes. The above is an example of one of the colours.

    Lastly i need an option which if the user clicks it will append: &autoplay=1 to the end of the YOUTUBEURL. This can be added in conjunction with a colour.

    Many Thanks for any help, it is really appreciated.
     
    wd_2k6, Mar 2, 2008 IP