Disable and enable a section with VBScript - InfoPath Dev
in

InfoPath Dev

Disable and enable a section with VBScript

Last post 08-26-2011 05:25 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-25-2011 11:54 PM

    Disable and enable a section with VBScript

     Hello everbody,

    first of all I don't know the exactly names of the elements in english, because I'm german and using the german version of Infopath. I started yesterday with using Infopath for adding listitems in Sharepoint. Now I would like to make an info-section(name=info_1), which is normally disabled. If the user clicks on the Button (name=info, text=show info) this info-section should be opened and the button-text should be changed to "hide". And if the user clicks again, the section should be disabled and the text should be "show info. I would like to do that with the help of VBscript, but I don't know how to make it. Could you maybe help me?

    I started with using this code, but it doesn't work. :) I never worked with a programming language, so I would be very happy if you can help me.

    Sub CTRL98_OnClick(eventObj)

    XDocument.DOM.selectSingleNode("/my:meineFelder/my:info_1").visible=true

    End Sub

     

    thank you

    Daniel

  • 08-26-2011 05:25 AM In reply to

    Re: Disable and enable a section with VBScript

    You shouldn't need code to do this.  Just create a Boolean field in your data source called showInfo1, and have it default to false.  Create two buttons, one that says Show, and one that says Hide.  Give the Show button a rule to set showInfo1 to true, and have Hide set showInfo1 to false.  Then add conditional formatting to hide the section and the Hide button when showInfo1 is equal to false, and to hide the Show button when showInfo1 is equal to true.  All done!

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.