Execute a function when selecting a option button - InfoPath Dev
in

InfoPath Dev

Execute a function when selecting a option button

Last post 07-17-2010 06:59 AM by Skarn. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 05-06-2010 04:20 AM

    Execute a function when selecting a option button

    Hi. I have managed to enable a dropdownlist (DDL) on the form when I press an option button. My question is how do I execute a function when I press an option button to fill the DDL? How do i connect the radio button with the function? Thank you!

  • 05-06-2010 06:11 AM In reply to

    Re: Execute a function when selecting a option button

     I was thinking at the gotfokus option but i cannot find it in Infopath for a control. Does it exists?

  • 05-06-2010 07:38 AM In reply to

    Re: Execute a function when selecting a option button

    Changed event

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 05-06-2010 10:19 AM In reply to

    Re: Execute a function when selecting a option button

     Hi. Can you provide an example please? Thank you.

  • 05-06-2010 11:00 AM In reply to

    Re: Execute a function when selecting a option button

    right click on the option button -> programming -> changed event.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 05-06-2010 11:39 PM In reply to

    Re: Execute a function when selecting a option button

     Hi. Thank you very much. It works very nice. But if I have a drop down list on the form and I want to populate it when I click on it, which enent do I use? If I use change I think it means that i must write something on it first rigth? This would not be the case because it has to be read only.Would Validating work? Thank you!

  • 05-07-2010 02:26 AM In reply to

    Re: Execute a function when selecting a option button

    there is no onclick event on drop down list, what you can do is, write the code on the changed event of option button, since this is going to be editable only when a certain option is selected. i guess your best bet is to populate it on Changed event of option button.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 05-07-2010 02:48 AM In reply to

    Re: Execute a function when selecting a option button

     Hi. I have understood that and it works fine, but imagine that on a form you have just a drop down list. When you click on it it must be automatically filled. How do u do this? Which event can I use? As I have noticed, it is not possible something like this because there are only to events to be used: validating and onchange. Is this correct? Thank you!

  • 05-07-2010 04:16 AM In reply to

    Re: Execute a function when selecting a option button

    The only click events in InfoPath are on buttons, not other controls.  If you really want to populate the dropdown based on a click, place a button next to it that is hidden or disabled once the dropdown is populated.  You haven't made it clear, though, why you want to have this behavior instead of populating it in advance.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-07-2010 04:57 AM In reply to

    Re: Execute a function when selecting a option button

     Hi. Thank you for your answer. Because I have tried to populate it using a dataconnection in the Infopath form and i got an error after publishing it. It was ok if I was chosing Continue, but it is not nice to have that error when you load the form. It has something to do with the password for connecting to the sql database; this is my gess. So i prefere to write code instead. I want to populate the DDL when i click on it because I do not want to have to many elements on that form. How could I populate it in advanced using just code? Thank you!

  • 07-17-2010 06:59 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Execute a function when selecting a option button

    I think I understand. You want the drop down box to only contain the values which are relevant to certain condition.

    But we need more information about the condition - does it change depending on what the user enter earlier in the form? Maybe you want it to be based on their logged in user name?

    Rather than looking for a 'click' event - try and identify at what point it becomes known what options the drop down list should contain and populate it then.

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