Can I set an Infopath 2003 form so it can't be submitted until the hyperlink it contains has been activated? - InfoPath Dev
in

InfoPath Dev

Can I set an Infopath 2003 form so it can't be submitted until the hyperlink it contains has been activated?

Last post 03-21-2009 04:53 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-20-2009 04:48 AM

    Can I set an Infopath 2003 form so it can't be submitted until the hyperlink it contains has been activated?

    Just a quick question, hopefully someone can help. I have an Infopath 2003 form that contains a Hyperlink. Is there any possible way for me to make it so that the form cannot be submitted until the user has clicked on the hyperlink? If so how would I go about doing this? Sorry if this is a silly thing to ask, but I am a bit of an Infopath beginner, and it has got me stumped as a hyperlink isn't a normal data source. Thanks.

    Filed under: ,
  • 03-21-2009 04:53 AM In reply to

    Re: Can I set an Infopath 2003 form so it can't be submitted until the hyperlink it contains has been activated?

    Hi:

    I don't see a way to do this using out of the box InfoPath functionality. I did, however, have luck using code -- I put the hyperlink control in a section (used only for that control) and then used the Context Change event to set another field that I based conditional formatting of the submit button on. This sample is in C# for IP 2003.To save the sample, right click on the link in the title area of the post, as 'Save As'. You should be able to then open in design mode and preview....

    The code is pretty simple -- in the OnContextChange event:

            public void FormEvents_OnContextChange(DocContextChangeEvent e)
            {
                if (e.Type == "ContextNode")
                {
                    //make sure it is our target group
                    string targetGroup = e.Context.nodeName;
     
                    if (targetGroup.Equals("my:group1"))
                    {
                        //set the field we are using to conditionally disable the submit button to true
                        thisXDocument.DOM.selectSingleNode("/my:myFields/my:IsEnabled").text = "true";
     
                    }
     
                    return;
                }
            }
    Hilary Stoupa

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