Pass value to dialog modal

programmer

I am using multiple buttons (dynamic) that opens a single div:

<div class="dialog" title="Player">
    <p>YouTube Player here</p>
</div>



and at the header I am using:

<script>
    $(function() {
        $(".dialog").dialog({
            autoOpen: false,
            show: {
                effect: "blind",
                duration: 1000
            },
            hide: {
                effect: "blind",
                duration: 1000
            }
        });

        $(".opener").click(function() {
            $(".dialog").dialog("open");
        });
    });
</script>



I get the buttons use like this:

foreach ($ytObject->RKT_requestResult->entry as $video) {
    return = $ytObject->parseVideoRow($video);
    $delimiter = "**";
    $VideoContent = explode($delimiter, $return);
    if ($count % 2 == 0) {
        echo "<div class=\"ResultEven\">";
        echo "<button class=\"opener btn\" class=\"btn\">Play</button>&nbsp;";
        echo "<a href = \"" . $VideoContent['0'] . "\" class=\"btn\">Download</a>&nbsp;";
        echo $VideoContent['6'];
        echo "</div>";
    } else {
        echo "<div class=\"ResultOdd\">";
        echo "<button class=\"opener btn\" class=\"btn\">Play</button>&nbsp;";
        echo "<a href = \"" . $VideoContent['0'] . "\" class=\"btn\">Download</a>&nbsp;";
        echo $VideoContent['6'];
        echo "</div>";
    }
    $count++;
}




I want to get the value of $VideoContent['0'] as the pop-up content of <div class="dialog" title="player"> so that I can put the YouTube video directly on the modal.

Code Lღver

Use the following code to get the value:

 $(".opener").click(function() {
     var video =  $(this).siblings("a").attr("href");
     alert(video); //here video will have the value of $VideoContent['0']
     $(".dialog").dialog("open");
 });

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to pass the interactive grid select value to the modal dialog page

From Dev

How to pass value to jquery dialog?

From Dev

How to pass and get modal value

From Dev

a href pass same value to the modal

From Dev

pass the database value to modal popup

From Dev

How to send href value in tablesorter to dialog modal?

From Dev

Pass data through levels - open Modal dialog at the end

From Dev

Android: Pass rating bar value to dialog

From Dev

Modal RCP Dialog not modal

From Dev

What would be the best way to pass a value to a modal?

From Dev

How to pass a php value on a modal? bootstrap 3,

From Dev

pass id value to ionic modal on click

From Dev

pass a value from mysql db to bootstrap modal

From Dev

How to pass current row value in modal?

From Dev

How to pass a id value to my modal in jsp?

From Dev

Pass value to modal and display as plain text

From Dev

How to pass a select value to Angularjs modal form

From Dev

Pass a value from javascript to bootstrap modal view

From Dev

Radio button input will not pass value to modal

From Dev

bootstrap-angular modal dialog: can not return value from select

From Dev

List object ID value bind with dialog modal property

From Dev

Get Value from JQuery Modal Dialog Submit to another Input Type

From Dev

How to pass multiple info to MDI Child Form from another modal dialog form

From Dev

How do i pass the ID of a row from my database to a modal dialog?

From Dev

href in modal dialog in bootstrap

From Dev

Passing parameters to modal dialog

From Dev

Validation in bootstrap modal dialog

From Java

Angular 2.0 and Modal Dialog

From Dev

Modal dialog to confirm delete

Related Related

HotTag

Archive