1

I have a text box in my page containing the code of JW player:

<div id="video-container">Loading the player ...</div>

<script type="text/javascript">
    jwplayer("video-container").setup({
        autostart: false,
        skin: "/skins/modieus/modieus.zip",
        image: "/wp-content/uploads/picture-filename.jpg",
        file: "/wp-content/uploads/video-filename.mp4",
        flashplayer: "/jwplayer/player.swf",
        volume: 80,
        width: 853,
        height: 480
    });
</script>                             

In addition, I have three other text areas and two checkboxes:

  1. The first textbox is the name of an image.
  2. The second is the name of a video file.
  3. The third is a separate placeholder where generated script output will be placed (see below).

You can see them in the above JavaScript:

  • image: "/wp-content/uploads/picture-filename.jpg"
  • file: "/wp-content/uploads/video-filename.mp4"

When you click the first checkbox, we need to grab the script from the text area and add the names of the image and video files from their own text boxes to it in the correct place. This generated code will then be added to the third text area at the bottom of the page.

If the user clicks the second checkbox, then the original (simple) code for the JW Player should be grabbed from text area and inserted into the third text area at the bottom of the page without any modifications.

What code do I need to use to make this happen? Is this better done through PHP on the server side or jQuery on the client side?

1
  • EAMann thanks for your help. Please be noted that the JW player code is in the custom Theme option textbox and the other textboxes are on custom post add new post page. Commented Oct 5, 2012 at 20:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.