1 Replies - 1728 Views - Last Post: 28 May 2012 - 03:00 AM Rate Topic: -----

#1 strawhat89  Icon User is offline

  • The Watcher Outside Your Window


Reputation: 247
  • View blog
  • Posts: 1,784
  • Joined: 11-July 11

Problem with ajax modal popup extender.

Posted 28 May 2012 - 02:43 AM

Hi, I have bit of a problem with the modal popup extender.

I have a button
asp:Button ID="RejectButton" runat="server" CssClass="button" onclick="RejectButton_Click"
Width="80px" Text="Reject" OnClientClick="javascript:return SelectValidatereject(RejectModalPanel)" />



This button is the target control for
<ajax:ModalPopupExtender runat="server" BackgroundCssClass="ModalBackground" TargetControlID="RejectButton"
ID="TestModalPopupExtender" PopupControlID="RejectModalPanel"
RepositionMode="RepositionOnWindowResize" PopupDragHandleControlID="RejectModalPanel">
</ajax:ModalPopupExtender>



The javascript function which runs onClientClick of RejectButton
function SelectValidatereject(RejectModalPanel) {
            var checkObj = 0;
            var targetcontrolid = document.getElementById("RejectWorkflowPopup");
            for (i = 0; i < document.PdwfmsForm.elements.length; i++) {
                if (document.PdwfmsForm.elements[i].name.indexOf("DeleteCheckBox") > -1) {
                    if (document.PdwfmsForm.elements[i].checked == true) {
                        var checkObj = 1;
                    }
                }
            }
            if (checkObj == 0) {
                alert("Select atleast one record");
                var mpu = $find('<%= TestModalPopupExtender.ClientID %>');
                mpu.dispose();
                return false;
            }
            else {
                return true;
            }
        }



As it can be seen, the function checks if a checkbox is checked and if its not, displays the alert box and is supposed to dispose of the Modal popup extender.

Everything works fine when the checkbox is checked. But when its not, the alert box displays fine; but once the function exits through return false, I get the error

"Microsoft JScript runtime error: Unable to get value of the property 'disabled': object is null or undefined" in this part

_onShow:function(a){if(!this.get_element().disabled){this.show();a.preventDefault();return false}}



I am also using an Update Panel... No idea why the error is appearing and I have been struggling for some time now. Hope you guys can help!

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with ajax modal popup extender.

#2 strawhat89  Icon User is offline

  • The Watcher Outside Your Window


Reputation: 247
  • View blog
  • Posts: 1,784
  • Joined: 11-July 11

Re: Problem with ajax modal popup extender.

Posted 28 May 2012 - 03:00 AM

I fixed the problem! Thanks anyways guys :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1