1

When CheckBox is unchecked in a ListView i need to get a popup window?

3 Answers 3

1

I have make a JS function and just pass id of your list like as

OnClientClick="return GetSelectedCheckBoxInGrid('grdCustomer');"

function GetSelectedCheckBoxInGrid(obj)
{              
      var con = 'ctl00_ContentPlaceHolder1_' + obj
      var Parent =  document.getElementById(con);
      var TargetChildControl = "chk";

      if (Parent==null)
      {
          return false;      
      }

      var items = Parent.getElementsByTagName("input"); 

      for(var n = 0; n < items.length; ++n)
         if(items[n].type == 'checkbox' && 
            items[n].id.indexOf(TargetChildControl,0) >= 0 && 
            items[n].checked == false)
           alert('Hi');return false;)

}

I think this is that

Sign up to request clarification or add additional context in comments.

Comments

0

Not too sure about this, but hypothetically, you could give each checkbox a class, eg chkbox, and then have some jquery code to handle a click event:

$('chkbox').click(function() { alert("here is where you put your popup code"); });

You could use window.open here

Comments

0
$('chkbox').click(function() {
  if (! $('#chkbox').is(':checked')) 
  {
    window.open ("http://www.javascript-coder.com","mywindow","status=1");
  } 
});

or

$('chkbox').click(function() {
  if(! $('#chkbox').attr('checked')) 
  {
    window.open ("http://www.javascript-coder.com","mywindow","status=1");
  } 
});

How to check whether a checkbox is checked in jQuery?

Comments

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.