Linking Toolbar Buttons to Script Functions - InfoPath Dev Sign in | Join | Help in Code InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Code » Linking Toolbar Buttons to Script Functions 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: Oldest to newest Newest to oldest Previous Next 09-27-2005 10:40 AM Gumboot Joined on 09-27-2005 Posts 4 Linking Toolbar Buttons to Script Functions Reply Contact 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 Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Linking Toolbar Buttons to Script Functions Mark as Not AnswerMark as Answer... Reply Contact 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 Please Visit:BraintroveGreg's Paintings 09-29-2005 09:28 AM In reply to Gumboot Joined on 09-27-2005 Posts 4 Re: Linking Toolbar Buttons to Script Functions Mark as Not AnswerMark as Answer... Reply Contact That worked thanks, 12-20-2005 10:08 PM In reply to qwer Joined on 10-03-2005 Posts 49 Re: Linking Toolbar Buttons to Script Functions Mark as Not AnswerMark as Answer... Reply Contact Greg,I tried this way in VB script but does not seem to work. I used instead:Sub foo_OnClick(eventObj)End SubNo 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.