Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. 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,

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,

Scheduled Pinned Locked Moved SharePoint
question
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 12443667
    wrote on last edited by
    #1

    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; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups