locked
FormServer.aspx displays webenabled infopath form as invalid html RRS feed

  • Question

  • I have a problem with the resulting HTML when a webenabled infopath is served to the user through FormServer.aspx.

    As you can see - a complete, extra <body>...</body> block is inserted before the <html> start-tag..

    Have any of you ever taken a look at the generated code, and if so, can you tell me if this is normal for SP2007.

    I even created a new form with only a textfield and a button to see whether layout from my forms was causing this - but same result.

    Here's the code that comes out ... down to when the real html begins:

    <body style='margin: 0px;overflow:auto;'><div style='height:0px'><div id='_InfoPath_WaitUI' style='height:0px'>
    <div style='position:absolute;text-align:center;'><div style='width:100%;'><table style='margin:75px;height:196px;width:447px;border:1px solid #5c7da4;background-color:white;z-index:2500' cellpadding='0' cellspacing='0'>
    <tr style="height:65px;width:100%;border:0;background-image:url('/_layouts/inc/IPFSDialogTopGrad.png?rev=aiK0%2FaEOabjixUERUkA3yg%3D%3D');background-color:#e5ebf2;">
    <td style='height:65px'>
    	<table cellpadding='0' cellspacing='0' border='0'>
    	<tr>
    		<td style='padding-left:21px;padding-right:21px;font:13pt Tahoma;color:black'>
    		</td>
    	</tr>
    	</table>
    </td>
    </tr>
    <tr>
    <td style='vertical-align:top;font:8pt Tahoma;color:black;padding-left:21px;padding-right:21px;padding-top:28px;padding-bottom:17px;background-color:white;text-align:center;'>
    	<div style='color:#333333;font-weight:bold;font:12pt Tahoma;'>Loading Form...</div>
    	<div style='padding-top:17px;'><img src='/_layouts/inc/activityanimation.gif?rev=sHmDD9LgTlytF%2FQiW0z%2Bow%3D%3D' width='78' height='7' style='border:0px none white' /></div>
    </td>
    </tr>
    <tr style='height:6px;background-color:#ECECEC'>
    	<td></td>
    </tr>
    <tr style="height:4px;background:url('/_layouts/inc/IPFSDialogBtmGrad.png?rev=la9GWlnH0bUlBEPW62ByBA%3D%3D') repeat-x; background-position:0 -37;">
    	<td></td>
    </tr>
    </table></div></div></div></div></body>
    <html>
    	<head><title>
     
    </title></head>

    I would be very interested in hearing from other users whether your HTML is invalid as well (letting me know that this is a SharePoint/formserver.aspx error), or if you have any ideas on how to fix this.

    Kind regards - Jakob :)


    • Edited by Jakob Krarup Wednesday, March 28, 2012 11:20 AM clarify question
    Wednesday, March 28, 2012 11:04 AM

Answers

  •  

    Hi Jakob,

    According to your description, I created a new web browser enabled infopath form and viewed the html source code of the form. The extra<body>…</body> is also inserted before the html. It’s really weird, but you can find a img link /_layouts/inc/activityanimation.gif in it, it looks like the loading bar of the form when you open it.

    So I created a new web browser enabled infopath form and add a Thread.Sleep() in the FormEvents_Loading Event. When you view the form in the browser, inspect the source of the html, you will find that only the extra<body>…</body> in the source code:

    The <html>…<html> form body will be transmit to client side later when the Thread.Sleep() ended.

    In my opinion, although SharePoint render the loading bar in this weird way, it does work in IE web browser.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    • Marked as answer by Jakob Krarup Wednesday, April 4, 2012 12:56 PM
    Tuesday, April 3, 2012 7:23 AM
  • Hi Jakob,

    This is something we were aware of in 2007 and changed the behavior in 2010. Not sure if you have migrated to 2010 yes but if you have a test machine, you should see this no longer occurs. 

    Scott


    Scott Heim - Microsoft Office InfoPath and SharePoint Designer Online Community Support

    • Proposed as answer by Scott He - MSFT Tuesday, April 3, 2012 12:35 PM
    • Marked as answer by Jakob Krarup Wednesday, April 4, 2012 12:56 PM
    Tuesday, April 3, 2012 12:35 PM

All replies

  •  

    Hi Jakob,

    According to your description, I created a new web browser enabled infopath form and viewed the html source code of the form. The extra<body>…</body> is also inserted before the html. It’s really weird, but you can find a img link /_layouts/inc/activityanimation.gif in it, it looks like the loading bar of the form when you open it.

    So I created a new web browser enabled infopath form and add a Thread.Sleep() in the FormEvents_Loading Event. When you view the form in the browser, inspect the source of the html, you will find that only the extra<body>…</body> in the source code:

    The <html>…<html> form body will be transmit to client side later when the Thread.Sleep() ended.

    In my opinion, although SharePoint render the loading bar in this weird way, it does work in IE web browser.

    Thanks,


    Lambda Zhao

    TechNet Community Support

    • Marked as answer by Jakob Krarup Wednesday, April 4, 2012 12:56 PM
    Tuesday, April 3, 2012 7:23 AM
  • Hi Jakob,

    This is something we were aware of in 2007 and changed the behavior in 2010. Not sure if you have migrated to 2010 yes but if you have a test machine, you should see this no longer occurs. 

    Scott


    Scott Heim - Microsoft Office InfoPath and SharePoint Designer Online Community Support

    • Proposed as answer by Scott He - MSFT Tuesday, April 3, 2012 12:35 PM
    • Marked as answer by Jakob Krarup Wednesday, April 4, 2012 12:56 PM
    Tuesday, April 3, 2012 12:35 PM
  • Hi Lambda 

    Thank you very much for verifying that it is not only on my server the problem exists :)

    Kind regards - Jakob

    Wednesday, April 4, 2012 12:54 PM
  • Hi Scott

    Thank you for verifying that this is a known bug.

    We are working as an independent contractor for the government, so I have no say in whether they will upgrade their SP installation soon.

    But it is nice to be able to tell them that this will be fixed as soon as they upgrade.

    Kind regards - Jakob

    Wednesday, April 4, 2012 12:56 PM
  • Hi Scott,

         I'm working with a client running SharePoint 2010.  Forms Services had broken and browser enabled forms are rendering improper HTML.  After inspecting the HTML returned via Fiddler or just by viewing source the HTML has normal beginning html and body tags but then looks to contain binary or ascii embedded.  I suspect a handler or something isn't interpretting the data properly.

          Any suggestions would be greatly appreciated.

    Thanks,

    Dennis


    Dennis Bottjer | Follow Me: @dbottjer | Blog: Dennis Bottjer.com

    Friday, April 13, 2012 7:57 AM