AutoFill text boxes with next 3 months - InfoPath Dev
in

InfoPath Dev

AutoFill text boxes with next 3 months

Last post 09-01-2011 10:57 PM by Patrick Halstead. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-30-2011 04:15 PM

    AutoFill text boxes with next 3 months

    Hello,

    I hope someone is able to help me with this project.

    I have 2 questions,  the first is:

    Is there a way to make it so a date picker,  allows you to only select a month? 
    For example,  you want to select 'August'

    The next question I have goes along with the first.

    Is it possible once a month has been select,  have 3 text boxes auto populate with the next 3 months names?

     

    Here is an example of what I've been asked to do:

    A user needs to submit a form.  
    In the dropdown they select August:

    Then elsewhere in the form,   3 text boxes auto fill with 

    September

    user inputs data for this month:

    October

    User inputs data for this month

    November

    User inputs data for this month

     

    Anyone know how to do something like this?

  • 08-31-2011 12:07 AM In reply to

    Re: AutoFill text boxes with next 3 months

    Use a dropdown for your months and then add a rule that sets a date in a separtate field. You can hide the original dropdown and replace it with a read-only date field that was set when they selected the dropdown. If you want to allow re-edits, you could add a small button next to the field that flips it back to show the dropdown and hide the other field. Put the fields in sections to make it easy to show-hide.

    To populate the other text boxes, you'll want to use an XML secondary data source (with the 12 months). Something like this:

    <months>
    <month>
    <index>1</index>
    <name>January</January>
    </month> 
    <month>
    <index>2</index>
    <name>February</January>
    </month> 
    ...

    Bind this to your dropdown. Now, when you select one, just add a rule that gets the next one in the list using a filter and the index for the selected plus one. Piece of tasty blackberry pie awaits you, but watch out for the InfoPath thorns... 

    :) 

    Patrick Halstead
    Project Manager at Qdabra
  • 08-31-2011 09:29 AM In reply to

    Re: AutoFill text boxes with next 3 months

    Hi,

    Thanks for your help. I was also thinking along these lines.

    So I have the dropdown in the form

    Display Name:  Month Names

    Values: 1-12

     I also added the XML file,  with a structure like this.

    <months>
    <month>
    <index>1</index>
    <name>January</name>
    </month>
    <month>
    <index>2</index>
    <name>February</name>
    </month>
    <month>
    </months>

    So now I'm not sure how to create the rules on my 3 other text boxes, to display the upcoming months.

    I also wasn't sure how to make it so it started over with January when the upcoming months go into the next year.

    Again, thanks for your help!

  • 09-01-2011 06:27 AM In reply to

    Re: AutoFill text boxes with next 3 months

     I've been trying to get this to work,  but not having any luck.

    How would you make the rules for updating the text boxes?

  • 09-01-2011 05:52 PM In reply to

    Re: AutoFill text boxes with next 3 months

     

    Does anyone know how to do this?

    I really need to get this working,  but I can't figure it out.

    Patrick, your suggestion seemed like it was on the right track.   But I'm just not sure how to implement it,  do you have any advice on how to make it work?

     

  • 09-01-2011 10:57 PM In reply to

    Re: AutoFill text boxes with next 3 months

    Hi,

    Sorry for delay, but it's been a busy week and we can't always respond immediately in the forum (because it's free and we do have to earn a living somehow ... ;)

    Do you know how to add a rule and an action to your InfoPath form's fields?

    In InfoPath 2007, right click and choose properties. You can access rules there. Add an action to set a field's value. Leave the condition blank. It will always set the value that way. Then add the function (click on Fx) to calculate it. If you have 2010, you have to click on Manage Rules on the ribbon and add via the taskpane. Same steps though.

    This is level 100 stuff. There is a lot of online training materials for InfoPath. You'll have to spend some time to learn it if you are going to use it. :)

    Or, you could ask us to deliver an hour of training to you. Go to Qdabra dot com and click Support and from there click Support Pack and you've got two options - emergency help or standard.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.