Hiding a control through dynamic scripting - InfoPath Dev
in

InfoPath Dev

Hiding a control through dynamic scripting

Last post 07-23-2010 05:23 AM by sivarao.n. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 03-12-2005 12:32 AM

    • amish
    • Not Ranked
    • Joined on 12-24-2004
    • India
    • Posts 19

    Hiding a control through dynamic scripting

    Hi Folks ,
    I am back with a new problem which i am not able to resolve.
    I tried finding it on net but was not able to find anything relevant to condtional formatting using scripts.

    Here is the Problem :

    Is it possible to Hide/Disable a control through scripting(jscript) in infopath?

    I know that at design time we can Hide/Disable controls but what abt controlling the behaviour(Hiding/Disabling) through scripts?

    Thanks in advance.

    Amish


    Amish
  • 03-12-2005 02:48 PM In reply to

    Re: Hiding a control through dynamic scripting

    Yes it is possible to Hide/Disable a control through Scripting.
    Here are the steps
    First write a method that returns a boolean value in your script.
    For ex:
    function isValid()
    {
    return true;
    }

    Now go to Infopath form Double click on the control that you want to make conditionally visible/disable
    - Go to Display tab
    - Click on Conditional formatting button.
    - Select expression in the First dropdown
    - give this expression in the text box "xdExtension:isValid()" if you want to do some activity when script returns true
    - Check Hide or Disable checkbox and click on Ok button

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 01-13-2009 11:44 PM In reply to

    Re: Hiding a control through dynamic scripting

    Thanks that was very useful for a beginner like me

  • 01-20-2009 10:55 AM In reply to

    UI-specific Information and Datasources

    A related strategy that I have used is to set up a UI state document similar to this

    <view1 state="" someOtherState="">
    <pane1 state=""/>
    <pane2 state=""/>
    </view1>

    Add the document as a Receive data connection. Despite the nature of the connection you can still write to the DOM. However, your changes will only last as long as the current session, which is often what you want. I think this is cleaner than some other solutions I've seen, and I've had good success with it.

     

    Cheers

     

  • 07-23-2010 05:23 AM In reply to

    Re: Hiding a control through dynamic scripting

    Hi Shanthi,

    Thanks for your post. It will very usefull post.

    But some it is not working for me, i am facing one issue. i.e  If i use expression with out quotes like xdExtension:isValid() everything working fine.

    But when i am trying to publish the infopath form i am getting error message like Unsupported expression.

    If i use expression with in quotes like  "xdExtension:isValid1()" this time we are not getting any error message but expression is not at all fireing.

    I don't know how to slove this problem.

    If you have any idea can you please help me.

    Thanks,

    Siva. 

     

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.