I have code to show confirm box on clicking on Close Button. And it should show a message along with the name of the month. The month names are in German, and German has special characters for some months like March - März.
The confirm box is not showing the speical characters. Can anyone please help me?
My code:
function chk_abschliessen()
{
var chk = confirm("Möchten Sie diesen Stundenzettel wirklich abschliessen?\nStundenzettel " + '@Model.monat.datum.Value.ToString("MMMM")' + " " + '@Model.monat.datum.Value.Year' + " ");
if (chk)
{
document.closebutton.submit()
}
else
{
return false;
}
}
The confirm box shows:
Möchten Sie diesen Stundenzettel wirklich abschliessen? Stundenzettel März 2016
I used a temporary solution, posting it here, as it might help someone else --
function clear_amp(data)
{
// for month "März"
var ret = data.replace("ä", "ä");
return ret;
}
//Abschliessen Messages Check - BEGIN
function chk_abschliessen()
{
var chk = confirm("Möchten Sie diesen Stundenzettel wirklich abschliessen?\nStundenzettel " + clear_amp('@Model.monat.datum.Value.ToString("MMMM")') + " " + '@Model.monat.datum.Value.Year' + " ");
if (chk)
{
document.closebutton.submit()
}
else
{
return false;
}
}