Can Someone Please Help (Forms/Textarea)

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

  1. #1
    Hi i have the following:

    onclick="this.form.text1.value=this.form.text1.value+'\n'+this.form.xyzvalue"

    So when the button is clicked it will add the text from xyz onto the END of my textarea.

    However i need it so that it adds the text halfway through the text area after a certain point.

    Basically the text inside my text area will be something like this:

    BLAH BLAH URL BLAH BLAH[CODE]
    
    I need when the button is clicked to place the value after the URL not at the end of the textarea!! How do i do this ive been searching for hours but can't find an answer to this simple problem!
    
    Many Thanks in advance.
    Code (markup):
     
    wd_2k6, Mar 15, 2008 IP
  2. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Geez, you might need a script or something with regular expressions to look for the [/url] part and stick the input after it. I don't know if you cna just put stuff like that after onClick either... it likely has to be some external script that looks for the url.

    Or, is the Blah Blah Blah before the URL never changing? You could have the whole Blah Blah Blah URL as a text chunk, add the input, and then add the last Blah Blah.
    I can't script but my idea is this:

    onclick="this.form.text1.value=this.form.text1.value+'\n'+this.form.xyzvalue+'\n'+this.form.text2.value"
    meaning you'd have to give the second Blah Blah a name and have it also rendered via script.
     
    Stomme poes, Mar 15, 2008 IP
  3. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well basically its just the Youtube embed code, so the blah blah will stay the same but the URL will always be diferent.

    I just want people to be able to change the colour of the Youtube Player, and have the option of turning autoplay on or off so i need to add text after the URL part.

    Basically i can keep the embed code the same and the URL will just be define by something like echo $url...

    I ain't got a clue where to start i'll head over to the Script forums let me know if you have some sort of solution, and thanks for the help.
     
    wd_2k6, Mar 15, 2008 IP