locked
Javascript pop-up on submit RRS feed

Answers

  • Hi,

         

    For client JS event, would you please try using button.attachEvent function?

     

    Like this:

     

    ---------------------------------------------------------------------------------

    var btn_submit=document.getElementById("btnID");

         

    btn_submit.attachEvent("onclick", validate);

     

    function validate ()

    {

        //…….

    }

    ---------------------------------------------------------------------------------

     

    You can add JS code in PlaceHolder:<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server"></asp:Content> Or CEWP(Contend Edit Webpart).

     

        Hope this can be helpful.

     

        Best Regards,

    -Aaron

    • Proposed as answer by shridha Tuesday, September 8, 2009 10:56 AM
    • Marked as answer by Jake Stabl, MCT Wednesday, September 9, 2009 11:43 PM
    Tuesday, September 8, 2009 10:44 AM

All replies

  • Since you have a customwebpart you can create on button a confirm popup.

    example:
    BtPublish.Attributes.Add("onclick", "return confirm('Want to submit Form?');");
    or can create a message
    BtPublish.Attributes.Add("onclick", "alert('submit Form');");

    André Lage Microsoft SharePoint and CRM Consultant
    Blog:http://aaclage.blogspot.com
    Codeplex:http://spupload.codeplex.com/http://simplecamlsearch.codeplex.com/
    Thursday, September 3, 2009 3:30 PM
  • yea i know i could write it on the webpart... but this is an immediate need of a customer and was looking for a quick an dirty way to put a javascript on the page.  Also this control is reused else where on the site and they don't need the pop-up on that control else where.
    www.sharepointbeginners.com
    Thursday, September 3, 2009 3:35 PM
  • Hi,

         

    For client JS event, would you please try using button.attachEvent function?

     

    Like this:

     

    ---------------------------------------------------------------------------------

    var btn_submit=document.getElementById("btnID");

         

    btn_submit.attachEvent("onclick", validate);

     

    function validate ()

    {

        //…….

    }

    ---------------------------------------------------------------------------------

     

    You can add JS code in PlaceHolder:<asp:Content ContentPlaceHolderId="PlaceHolderTitleAreaClass" runat="server"></asp:Content> Or CEWP(Contend Edit Webpart).

     

        Hope this can be helpful.

     

        Best Regards,

    -Aaron

    • Proposed as answer by shridha Tuesday, September 8, 2009 10:56 AM
    • Marked as answer by Jake Stabl, MCT Wednesday, September 9, 2009 11:43 PM
    Tuesday, September 8, 2009 10:44 AM