Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7029067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:29:23+00:00 2026-05-28T00:29:23+00:00

I have created a Check box JQuery Plugin, but when i want to get

  • 0

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.

JAVASCRIPT


function DialogWindowDragMediaItems(userPageType, imageParams, idParams) {


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

var divBGContainer = $("<div/>");
var lengthVideos = imageParams.split("~").length - 1;


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


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

var checkBox2 = $("<input type='checkbox'/>");
$(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 = $("<div/>");
$("body").append(divContainer);
$(divContainer).attr("class", "divaddvideomediacontrolcontainer");
$(divContainer).attr("id", id);

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

var divTopLeftCornerContainer = $("<div/>");
$(divInnerContainer).append(divTopLeftCornerContainer);
$(divTopLeftCornerContainer).attr("class", "divgenericwindowtopleftcorner");

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

var divTopRightCornerContainer = $("<div/>");
$(divInnerContainer).append(divTopRightCornerContainer);
$(divTopRightCornerContainer).attr("class", "divgenericwindowtoprightcorner");

var imageTitle = $("<img/>");
$(divTopCenterCornerContainer).append(imageTitle);
$(imageTitle).attr("class", "imagetitledialogwindow");
$(imageTitle).attr("src", imageUrl);

var divTitleContainer = $("<div/>");
$(divTopCenterCornerContainer).append(divTitleContainer);
$(divTitleContainer).attr("class", "divgenericwindowtitlecontainer");
$(divTitleContainer).text(title);

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

var divBottomLeftCornerContainer = $("<div/>");
$(divInnerContainer).append(divBottomLeftCornerContainer);
$(divBottomLeftCornerContainer).attr("class", "divgenericwindowbottomleftcorner");

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

var divBottomRightCornerContainer = $("<div/>");
$(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 && button.length > 0) {
    $(divBottomCenterContainer).append(button);
}


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

}


function GetDialogWindowButton(text, linkCall) {

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

var divCancel = $("<div/>");
$(linkCancel).append(divCancel);
$(divCancel).attr("class", "divlinkaddmediaurlbuttontext");
$(divCancel).text(text);

return linkCancel;
}

JQUERY CHECKBOX PLUGIN


(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 = $("<div style='clear:left;float:left;padding:10px;'/>");
    $(divContainer).insertAfter(this);

    var span = $("<span class='checkbox' style='float:left'/>");

    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 = $("<div style='float:left;margin-left:10px;disply:block'/>");
    $(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 < 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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:29:23+00:00Added an answer on May 28, 2026 at 12:29 am

    I split the code up from the button click event and then i could retrieve the value from the check box. Weird i still don’t understand why it shouldn’t work first time.

    function DialogWindowDragMediaItems(userPageType, imageParams, idParams) {
    
    
    idParams = idParams.replace(/~/g, "|")
    
    var divBGContainer = $("<div/>");
    var lengthVideos = imageParams.split("~").length - 1;
    
    
    var divInfoText1 = $("<div/>"); ;
    $(divBGContainer).append(divInfoText1);
    $(divInfoText1).text("What would you like to do with the videos selected?");
    $(divInfoText1).attr("class", "videosselecteddraginfo");
    
    
    var checkBox1 = $("<input type='checkbox'/>");
    $(divBGContainer).append(checkBox1);
    $(checkBox1).genCheckBox({ name: 'copymedia', text: 'Move and Copy', checked: true, id: 'copymediamoveandcopy' });
    
    var checkBox2 = $("<input type='checkbox'/>");
    $(divBGContainer).append(checkBox2);
    $(checkBox2).genCheckBox({ name: 'copymedia', text: 'Move and Delete' });
    
    
    
    
    var buttonMove = GetDialogWindowButton("Move Items", "");
    
    CreateGenericWindowDialog($(divBGContainer), "DialogWindowDragMediaItemsAddID", 500, "images/mainpage/dialogwindow/titleimageaddmedia.png", "Move Items", "Cancel", $(buttonMove), true);
    
    
    //$(buttonMove).attr("href", "javascript:DestroyDialogWindowHideTransparent('DialogWindowDragMediaItemsAddID'); WebForm_DoCallback('MainPageControl1','dragmediatomedia~" + userPageType + "~" + idParams + "~' + $('#copymediamoveandcopy').is('checked'),null,null,null,true)");
    
    $(buttonMove).attr("href", "javascript:MoveItemsClick('" + userPageType + "','" + idParams + "')");
    }
    
    function MoveItemsClick(userPageType, idParams) {
    
    var booleanValue = $('#copymediamoveandcopy')[0].checked;
    DestroyDialogWindowHideTransparent('DialogWindowDragMediaItemsAddID');
    WebForm_DoCallback('MainPageControl1', 'dragmediatomedia~' + userPageType + '~' + idParams + '~' + booleanValue, null, null, null, true);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created app using jQuery Mobile and need to get a Dialog box
I have created a dialog with the JQuery dialog plugin. My dialog is defined
I have created a User Control with 4 check boxes(server control). I want to
I have created a DeclarativeServiceLibrary using VS2010 beta 2, Please check this image of
Hey, so I have created a function to check the DB for unique entries,
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
I have already created a status item for the menu bar but I would
I have created a custom dialog box which requires 3 fields public class Test{
I have created a form online and when the user clicks submit I want
I have a page I created with jQuery, and in this page is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.