locked
How to hide custom submit button after form has been submitted infopath

    Question

  • I realize this is an easy question, and i have seen some post regarding a solution, however I do not know how to go about the solution.

    "Add a field that defaults to False. Set this field to True when the button is clicked after you successfully submit the form. Double click the section in the InfoPath designer and add a conditional display to hide the button if the field is True. "

    The bold portion is where I get lost.  I do not see where you can set a condition based on successful submit of a form.  There are only 6 actions that you can select based on any condition you provide and non of them concern submitting a form. Can someone please give me a step by step on how to hide a button AFTER the form has been submitted.

    thank you in advance.
    Thursday, October 15, 2009 10:14 PM

Answers

  • Hi Matt,

    1- Add a text field on the form using Controls and called it "FormStatus".
    Right click "FormStatus" button , Select Textbox properties, set default value "False"

    2- Create Submit data connection

    3-
    • Add a button on the form using Controls and called it "Submit".
    • Right click "Submit" button, Select Button properties, click Rules button.
    • Click Add button.
    • Click Add Action
    • Using Action dropdown select "Submit using a data connection " and select submit data connection created on step#2
    • Click Add Action again to add another action
    • Using Action dropdown select "Set a field's value " ,  select field: "FormStatus" , select value: True
    • Add Condition formatting on Submit button
      If "FormStatus" field is equal "True" , hide this control (Checked)



    Ashraf ul Islam
    Sharepoint Consultant
    • Marked as answer by Mattkenndy209 Friday, October 16, 2009 5:30 PM
    Thursday, October 15, 2009 10:51 PM

All replies

  • Add a field say 'hideSubmit' and set to false.
    Double click the submit button and add conditional formatting: If 'hideSubmit' is 'True' hide this control. Then press OK , OK ,  OK.

    Again double click submit button, open Rules: click add and under action select 'set a fields value'
    then for field, select 'hideSubmit' and value set to True.

    Make sure this rule is executes before the submit data connection is called. You can order rules by Move up/down buttons.
    Srinivas Varukala
    Thursday, October 15, 2009 10:48 PM
  • Hi Matt,

    1- Add a text field on the form using Controls and called it "FormStatus".
    Right click "FormStatus" button , Select Textbox properties, set default value "False"

    2- Create Submit data connection

    3-
    • Add a button on the form using Controls and called it "Submit".
    • Right click "Submit" button, Select Button properties, click Rules button.
    • Click Add button.
    • Click Add Action
    • Using Action dropdown select "Submit using a data connection " and select submit data connection created on step#2
    • Click Add Action again to add another action
    • Using Action dropdown select "Set a field's value " ,  select field: "FormStatus" , select value: True
    • Add Condition formatting on Submit button
      If "FormStatus" field is equal "True" , hide this control (Checked)



    Ashraf ul Islam
    Sharepoint Consultant
    • Marked as answer by Mattkenndy209 Friday, October 16, 2009 5:30 PM
    Thursday, October 15, 2009 10:51 PM
  • Thank you much Ashraf ul Islam!  That was exactly what I was looking for!

     

    Friday, October 16, 2009 5:32 PM
  • Matt and Ashraf,

    I am having the same problem that Matt was having.  I've tried your suggestion but the "submit" button is being hidden before i click submit.  I am not sure if i am doing something wrong, Can you help me with this.

    I believe i did exactly the following:

    1- Add a text field on the form using Controls and called it "FormStatus".
    Right click "FormStatus" button , Select Textbox properties, set default value "False"

    2- Create Submit data connection

    3-

    • Add a button on the form using Controls and called it "Submit".
    • Right click "Submit" button, Select Button properties, click Rules button.
    • Click Add button.
    • Click Add Action
    • Using Action dropdown select "Submit using a data connection " and select submit data connection created on step#2
    • Click Add Action again to add another action
    • Using Action dropdown select "Set a field's value " ,  select field: "FormStatus" , select value: True
    • Add Condition formatting on Submit button
      If "FormStatus" field is equal "True" , hide this control (Checked)



    I am new to InfoPath and i have spent many hours on this issue. I do have one other question "set default value "False""- Tell me if i am doing this correctly.

    Right click on the field
    Under "default Value click on  "Fx" to insert formula
    Click insert formula
    select  "false"
    Ok
    ok

    Thank you in advance,

    Tia

     

    Thank you,

    Tia

    Monday, December 14, 2009 9:53 PM
  • I would suggest that you use boolean field instead of text field for "FormStatus".

    From Design Tasks panel, click Data Source, right click myFields choose Add...

    Type FormStatus as Name, choose True/False (boolean) for Data type, then you will be able to choose FALSE for Default value from a dropdown list.

    In the Action box of seting Rule for submit button,
    Action: Set a field's value
    Field:
    FormStatus
    Value:
    true
    after OK, you should see Set a field's value:FormStaus="true"
    OK,OK...
    Then set Conditional Format,
    choose FormStatus is equal to TURE (dropdown list to choose), ticket Hide this control.

    have a try and see if it is working.
    Tuesday, December 15, 2009 2:40 AM
  • Thank you! !!!! It works!!

    Tia
    Tuesday, December 15, 2009 4:41 PM