Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why ÆØÅ become strange signs?

Status
Not open for further replies.

Petal

Programmer
Jun 8, 2001
56
0
0
NO
Hi
I have made a form that post values through a preview page to a servlet. The preview page is a javascript on the form page. On the preview page ÆØÅ become ÆØÅ, but when they are sendt to the servlet the become strange signs? Why does this happend? What can I do to prevent this?

Here is my code:
Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>

<html>
<head>
<title>NIK 2004 - Påmeldingsskjema</title>
<H1>NIK 2004 - Påmeldingsskjema</H1>

<script Language=&quot;JavaScript&quot;><!--


function preview(){
if(document.theForm.innkvartering[0].checked) {innkvartering=&quot;Hotell&quot;;}
else{ innkvartering=&quot;Ordner selv&quot;;}
tekst=&quot;<html><head></head><body>&quot;
tekst=&quot;<form action='servlet/PaameldingServlet' method='post'>&quot;
tekst=tekst+&quot;<table width='400'>&quot;
tekst=tekst+&quot;<tr><td>Fornavn:</td><td>&quot;+document.theForm.fornavn.value+&quot;<input type=hidden name='fornavn' value='&quot;+document.theForm.fornavn.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Etternavn:</td><td>&quot;+document.theForm.etternavn.value+&quot;<input type=hidden name='etternavn' value='&quot;+document.theForm.etternavn.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Epost adresse:</td><td>&quot;+document.theForm.epost.value+&quot;<input type=hidden name='epost'  value='&quot;+document.theForm.epost.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Telefon:</td><td>&quot;+document.theForm.telefon.value+&quot;<input type=hidden name='telefon'  value='&quot;+document.theForm.telefon.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Institusjon:</td><td>&quot;+document.theForm.institusjon.value+&quot;<input type=hidden name='institusjon'  value='&quot;+document.theForm.institusjon.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Adresse:</td><td>&quot;+document.theForm.adresse.value+&quot;<input type=hidden name='adresse'  value='&quot;+document.theForm.adresse.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Postnr:</td><td>&quot;+document.theForm.postnr.value+&quot;<input type=hidden name='postnr'  value='&quot;+document.theForm.postnr.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Poststed:</td><td>&quot;+document.theForm.poststed.value+&quot;<input type=hidden name='poststed'  value='&quot;+document.theForm.poststed.value+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td>Innkvartering:</td><td>&quot;+innkvartering +&quot;<input type=hidden name='innkvartering'  value='&quot;+innkvartering+&quot;'></td></tr>&quot;
tekst=tekst+&quot;<tr><td colspan=2 align='center'><input type='button' value='Forkast' onclick='history.back()'> <input type='submit' value='Godkjenn' name='sendt'></td></tr>&quot;
tekst=tekst+&quot;<tr><td colspan=2 align='center'><a href='index.jsp'>Til hovedsiden</a></td></tr>&quot;
tekst=tekst+&quot;</table>&quot;
tekst=tekst+&quot;</form>&quot;
	
document.write (tekst);
}
//--></script>
</head>

<body>
<form name=&quot;theForm&quot; action=&quot;javascript: preview()&quot; method=post >
<table width=&quot;400&quot;>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Fornavn:</td><td><input type=text name=&quot;fornavn&quot; maxlength=64 size=40></td></tr>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Etternavn:</td><td><input type=text name=&quot;etternavn&quot; maxlength=64 size=40></td></tr>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Epost adresse:</td><td><input type=text name=&quot;epost&quot; maxlength=255 size=40></td></tr>
	<tr><td>  Telefon:</td><td><input type=text name=&quot;telefon&quot; maxlength=15 size=15></td></tr>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Institusjon:</td><td><input type=text name=&quot;institusjon&quot; maxlength=255 size=40></td></tr>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Adresse:</td><td><input type=text name=&quot;adresse&quot; maxlength=255 size=40></td></tr>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Postnr:</td><td><input type=text name=&quot;postnr&quot; maxlength=4 size=6></td></tr>
	<tr><td><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font> Post sted:</td><td><input type=text name=&quot;poststed&quot; maxlength=255 size=40></td></tr>
	<tr><td valign=&quot;top&quot;>  Innkvartering:</td><td><input checked type=radio name=&quot;innkvartering&quot; value=&quot;Hotell&quot;> Hotell<br><input type=radio name=&quot;innkvartering&quot; value=&quot;Ordner selv&quot;> Ordner selv</td></tr>
	<tr><td colspan=2 align=&quot;center&quot;><input type=RESET value=&quot;Fjern alt&quot;> <input type=&quot;submit&quot; value=&quot;Bekreft&quot; name=&quot;sendt&quot;></td></tr>
        <tr><td colspan=2 align=&quot;center&quot;><a href=&quot;index.jsp&quot;>Til hovedsiden</a></td></tr>
<tr><td colspan=2><p><font color=&quot;#FF0000&quot; size=&quot;1&quot;>*</font><i> må fylles ut!</i></td></tr>
</TABLE>
</FORM>


</BODY>
</html>
Jørn Arild Andenæs
jaa@jaa.no
 
This seems to me like a codepage problem but don't really know how to solve it. Water is not bad as long as it stays out human body ;-)
 
I get øæå for æøå.

Jørn Arild Andenæs
jaa@jaa.no
 
Well, I marked this thread for email notification and the title became &quot;Why FXE become...&quot; So I continue thinking it's a codepage problem. May be you can solve this by an &quot;encode&quot;??? Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top