Hiding a date field and moving an Option Field - InfoPath Dev
in

InfoPath Dev

Hiding a date field and moving an Option Field

Last post 08-09-2007 06:14 AM by Clay Fox. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-08-2007 08:34 AM

    Hiding a date field and moving an Option Field

    Hi again guys - need some help.

    I have a two column layout.  the left column contains the description/label (in this case, Maturity Date) of the value/control (Date Picker) that will be entered in the right column, and I also have an Option Section right underneath the Date Picker Control, like this:

    __________________________________ 

    Maturity Date:  XXXXXXXXXXXX     

                           Option section 

    __________________________________ 

     (X = a Date Picker Control.  It is also formated so that it aligns with the words Maturity Date.)

    The user will have two options:  Pick a date from the Date Picker Control or choose a date or words that will be available in the Option Section.

    What I want to do is if the Date Picker Control is NOT picked, I want to hide that control and move the Option Section UP so that the words and dates that are in the Option Section move up to where the Date Picker control was, so that it aligns properly with the description/label on the left column.  Does that make sense?

    Currently, if the user does not pick a date and chooses a value in the option section, the form looks like this:

     ______________________________________________________________________________

    Maturity Date:      

                           The earlier to occur of the close of Construction Financing or XXXXXXXXXXXX .

    _______________________________________________________________________________

    X = date from Date Picker in the Options Section.

    That looks tacky.  Can anyone help me?  Thanks a lot

    Aye

     

    P.S.  The Date Picker Control's conditional formatting does not allow for this control to be hidden - go figure!!!???  And by the way, I'm using Infopath 2003

  • 08-08-2007 11:53 AM In reply to

    Re: Hiding a date field and moving an Option Field

    Yah date picker's cannot be hidden.

    I would recomend using two sections, one to handle each of your scenarios. Then use conditional formatting to hide / unhide each section as you need. If they select the optional section and datepicker is blank then hide the 1st section and show the second which does not have the date but the proper formatting you want.

  • 08-09-2007 03:49 AM In reply to

    Re: Hiding a date field and moving an Option Field

    CLAY U DA MAN! 

    That worked perfectly - it doesn't quite line up with the label on the left column - but I can live with it.

    One more question while I'm here:  I've tried to set the display of one of my Date Pickers several different ways to no avail.  In one of my columns, I have this sentence with a Date Picker in the middle, like so (X= Date Picker):

    "Principal and outstanding interest and all other charges shall be due at the earlier to occur of (i) XXXXXXX or (ii) upon maturity"

    However, when you pick a date, which I've formatted it as words and numbers instead of just a number (i.e., September 30, 2007 vs. 9/30/2007), it shows up like this:

    "Principal and outstanding interest and all other charges shall be due at the earlier to occur of (i) XXXXXXX                  or (ii) upon maturity."

    I'd like to close that gap between the Date Picker and the next word, in this case "or".  Like I mentioned above, I've tried setting the properties of the Date Picker in numerous ways, but I don't even come close.  If I drap the Date Picker control to the size of the largest date possible, which in this case would happend to be September 30, 2007, so that the next word "or" shows up right after it like in my first example above, it works, however, if you choose May 1, 2008, the gap in larger because obviously is set to the largest date possible.  Does that make sense?  I've set in on auto, but it doesn't work.

    Any help would be greatly appreciated.

    To those folks who come here asking questions (like me a total noob) or just reading to find your own fixes to problems, this is by far the best site I've come across on the NET!  Period!  The guys that give us the answers sure know their thing - and I thank you very very much for all the help you guys have given me.  Ok, enough brown nosin' - Thanks a lot.

    Aye

  • 08-09-2007 06:14 AM In reply to

    Re: Hiding a date field and moving an Option Field

    Your Welcome - I was once a newbie as well. My goal is to help you change your alias from Aye Caramba to No Problema! :)

    I would try adding your label to your sections too if possible and that may give you better formatting and work around the line up issue.

    Another trick is using expression boxes to display text.  It can be undetectable to the user but give you the ability to have a bit more control of the layout. You can right click and use borders and shading and set it to none.

    For the due date issue. In general only use the date picker if they really need to be able to choose a date. If you are just displaying a date or can use an existing chosen or calculated date use an expression box to display it read only.  InfoPath is very sensitive to horizontal space and only allows expansion or scrolling vertically. The simple reason is that if a line went long what would be the cascading effects and how would they be accounted for.

    In these particular cases, you would want to do a concatenation.  That way all of your text flows perfectly.  So you would insert an expression box for the whole line. Insert the concat function. concat("Principal and outstanding interest and all other charges shall be due at the earlier to occur of (i) " + my:EndDate + " or (ii) upon maturity.") However I cannot figure out how to keep the date formating with this. So you would have to give up good date formating or build the format yourself.  This would involve using the substring functions to take a date and break up the year, month, and date into three seperate fields, change month to a text if you wanted and then concatenate them all back together for your line of text.  You will have to decide how much it is worth.

    This is an example of what is possible but you would use an existing date or most likely calculate a date from the begining of the contract.  If you really are having them pick their own end date, they would have to pick it seperately to keep your display text pristine or live with what you currently have. One thought to is that you could have the text up to the date picker. Have your date picker but once they entered a value it would hide. Then the second part of the text would be the expression box described above and it would work the way you wanted it.

    Have fun.

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