Friday, February 5, 2010

Displaying alert message while saving a infopath form.

You might have marked that, in each and every infopath form, there are two buttons 'save and close'. There might be requirement for displaying a alert message on the click event of the save button.

To achive this , open the core.js file from this location \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\INC and serach Toolbar.ExecuteAction and update the script by looking to the below script.

.
.
.
.
.
Toolbar.ExecuteAction = function(strAction, objEvent)
{if (!BaseControl.CanHandleEvents())


{return;}


switch(strAction)


{case ("refresh"):


{if (document.forms[0] != null)


{View_SubmitForm(false , 24, 0, false );}


break;}


case ("submit"):


{if (View.PreSubmitActions())


{EventLog_Add(


9,


null,


"",


"",


"",


true ,


false ,


false ,


9,


0);}


break;}


case ("view"):


{;


break;}


case ("save"):


{EventLog_Add(


14,


null,


"",


false,


false,


true ,


false ,


false ,


10,


0);alert('Data Saved Successfully');


break;}


case ("saveAs"):


{EventLog_Add(


14,

.
.
.


No comments:

Post a Comment