JQuery Checkbox value not working
<p>I have created a Check box JQuery Plugin, but when i want to get the value of the check box when selected the check box value always returns false. I have taken out the plugin and used the check box in a raw state but still returns false when check box is selected.</p>

<p>JAVASCRIPT</p>

<hr>

<pre><code>function DialogWindowDragMediaItems(userPageType, imageParams, idParams) {


idParams = idParams.replace(/~/g, "|")

var divBGContainer = $("&lt;div/&gt;");
var lengthVideos = imageParams.split("~").length - 1;


var divInfoText1 = $("&lt;div/&gt;"); ;
$(divBGContainer).append(divInfoText1);
$(divInfoText1).text("What would you like to do with the videos selected?");
$(divInfoText1).attr("class", "videosselecteddraginfo");


var checkBox1 = $("&lt;input type='checkbox'/&gt;");
$(divBGContainer).append(checkBox1);
$(checkBox1).genCheckBox({ name: 'copymedia', text: 'Move and Copy', checked: true });
$(checkBox1).attr("id", "copymediamoveandcopy");

var checkBox2 = $("&lt;input type='checkbox'/&gt;");
$(divBGContainer).append(checkBox2);
$(checkBox2).genCheckBox({ name: 'copymedia', text: 'Move and Delete' });




var buttonMove = GetDialogWindowButton("Move Items", "DestroyDialogWindowHideTransparent('DialogWindowDragMediaItemsAddID'); WebForm_DoCallback('MainPageControl1','dragmediatomedia~" + userPageType + "~" + idParams + "~' + $('#copymediamoveandcopy').is(':checked'),null,null,null,true)");

CreateGenericWindowDialog($(divBGContainer), "DialogWindowDragMediaItemsAddID", 500, "images/mainpage/dialogwindow/titleimageaddmedia.png", "Move Items", "Cancel", buttonMove, true);


}


function CreateGenericWindowDialog(content, id, width, imageUrl, title, buttonText, button, destroyAndHideTransparent) {

var divContainer = $("&lt;div/&gt;");
$("body").append(divContainer);
$(divContainer).attr("class", "divaddvideomediacontrolcontainer");
$(divContainer).attr("id", id);

var divInnerContainer = $("&lt;div/&gt;");
$(divContainer).append(divInnerContainer);
$(divInnerContainer).attr("class", "divaddvideomediainnercontrolcontainer");
$(divInnerContainer).css("width", width + "px");

var divTopLeftCornerContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divTopLeftCornerContainer);
$(divTopLeftCornerContainer).attr("class", "divgenericwindowtopleftcorner");

var divTopCenterCornerContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divTopCenterCornerContainer);
$(divTopCenterCornerContainer).attr("class", "divcentergenericwindow");
$(divTopCenterCornerContainer).css("width", width - 16 + "px");

var divTopRightCornerContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divTopRightCornerContainer);
$(divTopRightCornerContainer).attr("class", "divgenericwindowtoprightcorner");

var imageTitle = $("&lt;img/&gt;");
$(divTopCenterCornerContainer).append(imageTitle);
$(imageTitle).attr("class", "imagetitledialogwindow");
$(imageTitle).attr("src", imageUrl);

var divTitleContainer = $("&lt;div/&gt;");
$(divTopCenterCornerContainer).append(divTitleContainer);
$(divTitleContainer).attr("class", "divgenericwindowtitlecontainer");
$(divTitleContainer).text(title);

var divControlsContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divControlsContainer);
$(divControlsContainer).attr("class", "divgenericwindowcontrolscontainer");
$(divControlsContainer).css("width", width - 6 + "px");
$(divControlsContainer).append($(content));

var divBottomLeftCornerContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divBottomLeftCornerContainer);
$(divBottomLeftCornerContainer).attr("class", "divgenericwindowbottomleftcorner");

var divBottomCenterContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divBottomCenterContainer);
$(divBottomCenterContainer).attr("class", "divbottomcentergenericwindow");
$(divBottomCenterContainer).css("width", width - 16 + "px");

var divBottomRightCornerContainer = $("&lt;div/&gt;");
$(divInnerContainer).append(divBottomRightCornerContainer);
$(divBottomRightCornerContainer).attr("class", "divgenericwindowbottomrightcorner");

if (destroyAndHideTransparent) {
    $(divBottomCenterContainer).append(GetDialogWindowButton(buttonText, "DestroyDialogWindowHideTransparent('" + id + "')"));
}
else {
    $(divBottomCenterContainer).append(GetDialogWindowButton(buttonText, "DestroyDialogWindow('" + id + "')"));
}



if (button != null &amp;&amp; button.length &gt; 0) {
    $(divBottomCenterContainer).append(button);
}


CenterGenericControl(id);
$(divContainer).show();

}


function GetDialogWindowButton(text, linkCall) {

var linkCancel = $("&lt;a/&gt;");
$(linkCancel).attr("class", "linkgenericdialogbutton");
$(linkCancel).attr("href", "javascript:" + linkCall);
$(linkCancel).css("marginTop", 14 + "px");
$(linkCancel).css("marginRight", 10 + "px");

var divCancel = $("&lt;div/&gt;");
$(linkCancel).append(divCancel);
$(divCancel).attr("class", "divlinkaddmediaurlbuttontext");
$(divCancel).text(text);

return linkCancel;
}
</code></pre>

<p>JQUERY CHECKBOX PLUGIN</p>

<hr>

<pre><code>(function($) {

$.fn.genCheckBox = function(settings) {

    var def = {

        height: 15,
        width: 15

    };

    settings = $.extend(def, settings)

    $(this).attr("name", settings.name);
    $(this).css("display", "none");

    $(this).prop("checked", settings.checked);


    var divContainer = $("&lt;div style='clear:left;float:left;padding:10px;'/&gt;");
    $(divContainer).insertAfter(this);

    var span = $("&lt;span class='checkbox' style='float:left'/&gt;");

    if (settings.checked) {
        $(span).css("background-position", "0px 17px");
    }
    else {
        $(span).css("background-position", "0px 0px");
    }

    $(divContainer).append(span);
    //$(span).attr("name", settings.name);

    var div = $("&lt;div style='float:left;margin-left:10px;disply:block'/&gt;");
    $(div).insertAfter(span);
    $(div).text(settings.text);

    $(span).click(function() {

        var position = $(this).css("background-position");

        if (position == '0px 0px') {

            $(".checkbox").css("background-position", "0px 0px");
            var el = document.getElementsByName(settings.name);

            for (var i = 0; i &lt; el.length; i++) {

                var input = el[i];
                $(input).prop("checked", false);

            }

            $(this).css("background-position", "0px 17px");
            var checkBox = $($(this).parent()).prev();
            $(checkBox).prop("checked", true);
        }

    });


}



})(jQuery);
</code></pre>
