Inactivate button when date is exceeded - InfoPath Dev
in

InfoPath Dev

Inactivate button when date is exceeded

Last post 02-27-2012 07:00 AM by Joern. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 02-22-2012 07:26 AM

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Inactivate button when date is exceeded

    Hi folks,

    I have a form in which the user is asked to do his input until a certain date and time, e.g. until March 6th, 2012 11:00 p.m. and to send his input via clicking a button to a sharepoint list.

    When the date and time is exceeded I want to inactivate the button, so that the user cannot send his input anymore.

    How can I do this?

    Any hints or suggestions?

    Thank you very much in advance.

    Cheers

    Joern

  • 02-22-2012 08:35 AM In reply to

    Re: Inactivate button when date is exceeded

    Store the date time in a form field. Add conditional formatting to the button to disable if that field is <= now(). I think that will evaluate when the template is opened - so then on the button itself, add the same logic as a condition before running the submit action - so that it is re-evaluated (that is, I've opened the form, left it open for an hour, and my time has expired - the button's conditional formatting may not refresh, but you can still check prior to allowing a submit).

    I've not tried this - just sort of my best off-hand guess. :-)

    Hilary Stoupa

  • 02-22-2012 10:52 PM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Inactivate button when date is exceeded

    Hi Hilary,

    thanks so much. You're my IP rock ;-) It worked well.

  • 02-23-2012 06:55 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Inactivate button when date is exceeded

    Can I do this with a text field as well?

    I mean, I want to inactivate a textfield when the date is exceeded. I solved this with a rule.

    The remaining problem is: The form is being opened before the date is exceeded. Then, I leave the form open until the date is exceeded and the textfield is still activated because the deadline is not re-evaluated. How can I get the field inactivated automatically when the time exceeds while the form is being opened?

  • 02-23-2012 05:32 PM In reply to

    Re: Inactivate button when date is exceeded

    See - that is going to be tough without code of some kind.

    I think what I'd do is get the value of the text field on form open and store it somewhere, like a simple XML secondary data source. Then, again, when they try to submit, if they are past the deadline of time, set it back to its original value.... of course, since you won't let them submit, I guess it will be the original value the next time they open the form....

    Hilary Stoupa

  • 02-23-2012 10:35 PM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Inactivate button when date is exceeded

    It's a little tricky:

    It should be a blank textfield in what the user can do some input  - until the deadline is not exceeded. If the deadline is exceeded, the textfield should be inactivated so that the user cannot do his input anymore.

  • 02-24-2012 08:39 AM In reply to

    Re: Inactivate button when date is exceeded

    But to actually save the user's input, he'd have to submit his form, right? Since you have this time limit on things, I'm assuming you won't allow the user to Save or Save As - that you'd disable those controls.... So as long as you are controlling whether the user can submit based on the deadline you are storing in the form, wouldn't that prevent the user from submitting changes whether or not the actual control was disabled?

    Hilary Stoupa

  • 02-27-2012 07:00 AM In reply to

    • Joern
    • Top 150 Contributor
    • Joined on 09-28-2010
    • Posts 79

    Re: Inactivate button when date is exceeded

    I have a repeating table being populated from a secondary data source.

    Each row in the repeating table has its own deadline. Once the deadline is expired, the user should not be able to do his input in this very row.

    In the rows whose deadline is not yet expired, the user should still be able to do his input - and only this input should be send to the SharePoint via the 'Submit'-button.

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