I need to open model popup (i.e) confirmation Box , if user clicks "ok" then open infopath form in Edit mode, "cancel" then open infopath form in Read-only mode,
-
Before showing info-path form ,need to open model popup (i.e) confirmation Box , if user clicks "ok" then open infopath form in Edit mode, "cancel" then open infopath form in Read-only mode. FormCode.cs file public void FormEvents_Loading(object sender, LoadingEventArgs e) { StringBuilder sb = new StringBuilder(); sb.Append(@""); sb.Append(@"var r = confirm('do you want to Checked-Out?');"); sb.Append(@"if((r == true))"); sb.Append(@"{"); string s = Success(); sb.Append(s); sb.Append(@"}"); sb.Append(@"else"); sb.Append(@"{"); string s1 = Failure(); sb.Append(s1); sb.Append(@"}"); sb.Append(@""); } public string Success() { string result = string.Empty; XPathNavigator root, infopathNode; root = this.MainDataSource.CreateNavigator(); infopathNode = null; infopathNode = root.SelectSingleNode(path, this.NamespaceManager); DeleteNil(infopathNode); infopathNode.SetValue("0"); result = "alert('sucess method triggered');"; return result; } public string Failure() { string s = string.Empty; XPathNavigator root, infopathNode; root = this.MainDataSource.CreateNavigator(); infopathNode = null; infopathNode = root.SelectSingleNode(path, this.NamespaceManager); DeleteNil(infopathNode); infopathNode.SetValue("0"); s = "alert('Failure method triggered');"; return s; }