Firing modal popup with javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rrocket
    New Member
    • Aug 2007
    • 116

    Firing modal popup with javascript

    I am trying to get a modal popup to display on an onblur event, but I keep getting a "'null' or is null or not an object" js error.

    I have seen many examples using
    [code=javascript]
    var _popup;
    _popup = $find('MPE');
    _popup._show();
    //And
    $find('MPE')._s how();
    //And
    $object('MPE'). _show()
    [/code]

    But none of them work. I just need to fire the Modal Popup on the client side...

    Code for the Modal Popup:
    [code=c#]
    <cc1:ModalPopup Extender ID="MPE" runat="server"
    TargetControlID ="TestButton "
    PopupControlID= "pnlWeightMessa ge"
    BackgroundCssCl ass="modalBackg round"
    DropShadow="tru e"
    OkControlID="Ba cktoForm"
    />
    [/code]

    Thanks
  • rrocket
    New Member
    • Aug 2007
    • 116

    #2
    I figured it out.

    Here is the info if anyone else has the same issue:
    [code=html]
    <cc1:ModalPopup Extender ID="MPE" runat="server"
    TargetControlID ="TestButton "
    PopupControlID= "pnlWeightMessa ge"
    BackgroundCssCl ass="modalBackg round"
    DropShadow="tru e"
    OkControlID="Ba cktoForm"
    BehaviorID="MPE " <!-- Added behavior to the control and named it the same as the ID-->
    />
    [/code]
    [code=javascript]
    //Once I added the behavior this
    $find('MPE').sh ow();
    //worked to call the Modal Popup from the javascript function
    [/code]

    Comment

    Working...