Linking Toolbar Buttons to Script Functions - InfoPath Dev
in

InfoPath Dev

Linking Toolbar Buttons to Script Functions

Last post 12-20-2005 10:08 PM by qwer. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-27-2005 10:40 AM

    Linking Toolbar Buttons to Script Functions

    I've been looking at the MS examples of creating custom Toolbar buttons, however they do not show how to link them to actual scripts embedded in the Form.

    Does someone have an example for me to look at?

    Many thanks in Advance
  • 09-28-2005 02:20 PM In reply to

    Re: Linking Toolbar Buttons to Script Functions

    The xsf:button element has a name attribute which defines which OnClick handler to associate with the button. So if you had:

    <xsf:button name="foo"... />

    then when you click that button it calls into your script looking for:

    function foo()
    {...}

    I don't recall if you need to format the function like any other OnClick handler. If that is the case your function will look like:

    function foo::OnClick(eventObj)
    {...}

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 09-29-2005 09:28 AM In reply to

    Re: Linking Toolbar Buttons to Script Functions

    That worked thanks,
  • 12-20-2005 10:08 PM In reply to

    • qwer
    • Top 500 Contributor
    • Joined on 10-04-2005
    • Posts 49

    Re: Linking Toolbar Buttons to Script Functions

    Greg,

    I tried this way in VB script but does not seem to work. I used instead:

    Sub foo_OnClick(eventObj)

    End Sub

    No matter what code I put in there it just says script error exist. Please help, anyone?
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.