I am using following code to change the language of HTML form on application page:
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script type="text/javascript" src="/_layouts/SP.Core.js"></script>
<script type="text/javascript" src="/_layouts/SP.Debug.js"></script>
<script type="text/javascript" src="/_layouts/SP.Runtime.Debug.js"></script>
<script type="text/javascript">
function ChangeLanguage(value) {
var today = new Date();
var oneYear = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
var url = window.location.href;
document.cookie = "lcid=" + value + ";path=/;expires=" + oneYear.toGMTString();
window.location.href = url;
}
</script>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<form>
// My Html form is here.. with 3 input type text and one input type submit button
<a href="#" onclick="javascript:ChangeLanguage(1053);">swedish</a>
<a href="javascript:ChangeLanguage(1033)">english</a>
</form>
</asp:Content>
When i click on any of the hyperlinks above, nothing happened. I could not understand, what is wrong? I am using two types of links, but neither works
<form>tag in application page! Also putalert('function called');in your JavaScript function to see if it is ever called... – Arsalan Adam Khatri Dec 17 '12 at 15:00<script>tag in "PlaceHolderAdditionalPageHead", place it inside "Main" without<form>– Arsalan Adam Khatri Dec 17 '12 at 15:32