YES/NO Button - InfoPath Dev
in

InfoPath Dev

YES/NO Button

Last post 04-11-2007 12:21 AM by nukkumatti. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-10-2007 12:30 PM

    YES/NO Button

    I am trying to create a document with choices.

    Here is a sample layout of what I am trying to do.

    Is Task 1 complete?
    (button) Yes (button) No

    Would like to accomplish:
    1) If they select "Yes" (button) it will take them to Is Task 2 complete?
    2) If they select "No" (button) it will display an text error box to do (X before proceeding)

    Then if they go to Task 2 the same thing and so on, and so on.
  • 04-10-2007 11:53 PM In reply to

    Hi

    Here is the steps to hide and show the controls using Yes and No option buttons

    1. Open form in designer mode
    2. Go to Properties window of 'Task 2 Complete' section
    3. click on Display tab
    4. click on 'conditional formatting' button
    5. click on 'Add' button
    6. select the option radio button field in the first drop down box
    7. select 'is not equal to' in the second dropdown box
    8. Select Type a number' in third drop down box and enter '1'
    9. Check 'Hide this control' check box
    10. Click 'Ok' three times
    11. Similarly Go to Properties window of the text Box
    12. click on Display tab
    13. click on 'conditional formatting' button
    14. click on 'Add' button
    15. select the option radio button field in the first drop down box
    16. select 'is not equal to' in the second dropdown box
    17. Select Type a number' in third drop down box and enter '0'
    18. Check 'Hide this control' check box
    19. Click 'Ok' three times
    20. Save the form
    Madhuri
    http://www.ggktech.com
  • 04-11-2007 12:21 AM In reply to

    Hi Michael,

    just an idea. I would may be name the button "Task Done" or something. Then double click the button and click the "Edit Code"
    button. Now use custom code to check if all your required fields are filled out correctly (e.g. field1 is a text box for which you want to test if it is filled or not)

    if(XDocument.DOM.selectSingleNode(my:myFields/my:field1).text != "")
    {
    XDocument.View.SwitchView("viewName");
    }
    else
    {
    XDocument.UI.Alert("Your alert message");
    }


    Hope this helps
    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.