Howto: button code to open form from web page

P

Patrick Temple

How do I create a button on a web page to open an Infopath form to fill out?
 
S

Scott L. Heim [MSFT]

Hi Patrick,

Just as a clarification - any user that wants to interact with an InfoPath
form (i.e. fill it out) will need to have InfoPath installed on their
machine.

Now with that said, here are steps for a quick and easy sample:

- Launch Notepad
- Paste in the following code:

<HTML>
<BODY>
<BUTTON ID="Button1" >Open InfoPath Form </BUTTON>
</BODY>

<script language=vbscript>
Function Button1_OnClick()
Window.open "Form1.xml"
End Function
</script>
</HTML>

- Save this in your wwwroot folder as: OpenIPTest.HTM
- Double-click any existing InfoPath XSN you have and save the form as
Form1.XML in the wwwroot folder
- Launch IE, load OpenIPTest.HTM and click the button - result: the
InfoPath form should be loaded using InfoPath.

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Patrick Temple

Scott,

Thanks, If this works it will really save my bacon.

I'll need to modify your example a bit but should be able to make it go.

One question, I'm using Sharepoint Services are there any hangups I need to
be aware of? This looks pretty straight forward so I'm thinking there won't
be but sometimes Sharepoint is finnicky.

Thanks again

--Patrick
 
S

Scott L. Heim [MSFT]

Hi Patrick,

Off the top of my head I cannot think of any...but the sample I provided
was not tested from a Sharepoint page so be sure to fully test.

Good luck!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top