Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have written an html code to generate the form and when i click on save as it should get saved in html format.
XML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ Page Language="C#" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
<meta name="WebPartPageExpansion" content="full" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
<style type="text/css">
body #s4-leftpanel {
	display: none;
}
.s4-ca {
	margin-left: 0px;
}
</style>
<script type="text/javascript">
function saveIt(){
var now= new Date();
var year    = now.getFullYear();
var month   = now.getMonth()+1; 
var day     = now.getDate();
var hours=now.getHours();
var minutes=now.getMinutes();
var seconds=now.getSeconds();

var currentdate=year+""+month+""+day+""+hours+""+minutes+""+seconds;
var thisUserName = $().SPServices.SPGetCurrentUser	({	fieldName: "Name",	debug: false });
var uname=thisUserName.split('\\')[1];

var filename= uname+"-"+currentdate;
document.execCommand("SaveAs", false, filename+".html");
}

function printIt()
{	
window.print();
}

</script>

</head>

<body>

<form id="form1" runat="server">
<div class="fltl">
                    	<label title="Name of Principal Office" class="flight12 fltl mt5 mb5" tabindex="0">
						Name of Principal Office<span class="asterisk posrl">*</span></label> 
                        <span class="info-icon cp fltl ml5 mt5">
                            	<img src="../Style Library/Gift Funds Images/infoicon.png" alt="Info"/>
                        </span>
                        <div class="principaloffice-dropdown ovrh fltl clrl mb5 mt3">
                        	<select class="pt2 flight12" id="principaloffice">
							</select>
                        </div>
                        <div class="iblock clrl fltl mt5">
                        	<span class="color-red flight12 posrl hidden" id="principalofficerrmsg">
							</span>
                         </div>	
                    </div>
</form>

</body>

</html>


the form is getting saved in local but when v reopen the saved html form its showing an error as SCRIPT5009: 'RegisterSod' is undefined
can any one help on this.....
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900