ændring af pop_up titel
Hej!Jeg sidder med lidt ASP og er rendt ind i det problem, at jeg ikke kan få skidtet til at 'fatte', når jeg ændrer mine pop_up menuer. Den bliver ved med at skrive, hvad der før stod i filen. Det, jeg prøver på at gøre, er, at ændre mine pop-up'er fra engelsk til dansk, da jeg nu skal bruge det på et andet site. Nedenfor har jeg indsat tre filer, som indgår i denne validering...håber der er et klog hoved, der kan hjælpe mig hurtigst muligt?
Første fil (sign_kokken.asp) er den jeg tilføjer på og som kalder valideringen;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Systematics homekitchen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script language="JavaScript">window.status = ""</script>
<script language="javascript" src="validering_kokken.js"></script>
<style type="text/css">
<!--
@import url("systematic.css");
-->
</style>
<style>
BODY { SCROLLBAR-FACE-COLOR: #ffffff;
SCROLLBAR-HIGHLIGHT-COLOR: #ff0000;
SCROLLBAR-SHADOW-COLOR: #cccccc;
SCROLLBAR-3DLIGHT-COLOR: #DFDFDF;
SCROLLBAR-ARROW-COLOR: #ff0000;
SCROLLBAR-TRACK-COLOR: #ffffff;
SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
</style>
</head>
<body>
<table width="680" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80"><img src="grafik/trans.gif" width="80" height="30" border="0"></td>
<td colspan="3"> </td>
</tr>
<tr>
<td> </td>
<td width="12" valign="top" class="overskrifter"><span class="administration"><a href="administration.asp" onFocus="this.blur()" target="_self"><img src="grafik/trekant_tilbage.gif" width="12" height="17" border="0"></a></span>
</td>
<td width="10" valign="top" class="overskrifter"><span class="administration"><img src="grafik/trans.gif" width="30" height="6"></span><br>
</td>
<td width="578" valign="top" class="overskrifter"><div align="left">Admin
- tilføj til køkkenet<br>
<img src="grafik/trans.gif" width="6" height="20"></div></td>
</tr>
<tr>
<td> </td>
<td colspan="3" class="broedtxt"><form name="new_comment" action="add_kokken.asp" method="post">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="96" height="30" class="mellemoverskrift"> Overskrift</td>
<td width="315" height="30"> <input name="navn" type="text" class="inputfield" size="30">
</td>
</tr>
<tr>
<td height="30" class="mellemoverskrift"> Afdeling</td>
<td height="30"> <input name="email" type="text" class="inputfield" value="kokkenet@systematic.dk" size="30"></td>
</tr>
<tr>
<td height="30" valign="top" class="broedtxt"> <img src="grafik/trans.gif" width="6" height="2"><br>
<span class="mellemoverskrift">Kommentar</span> </td>
<td height="30"><textarea name="text" rows="10" cols="39" wrap="virtual" class="inputfield"></textarea></td>
</tr>
<tr>
<td> </td>
<td height="45"> <input type="hidden" name="StrMode" value="new_comment">
<input name="button" type="button" class="button" onFocus="this.blur()" onClick="validering()" value="tilføj til køkkenet">
</td>
</tr>
<tr>
<td height="30" colspan="2"> <table border="0" bordercolor="#000000" <% if Session("error") = true then response.write "cellpadding=""5""" else response.write "cellpadding=""0""" end if %> cellspacing="0">
<tr>
<td class="broedtxt" <% if Session("error") = true then response.write "bordercolor=""red""" end if %> >
<%
if Session("error") = true then
response.write "Following mistake has occured<br>" & Session("message")
Session("error") = false
end if
%> </td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
<p>
<map name="Image3Map">
<area shape="rect" coords="2,2,112,25" href="#">
</map>
<map name="Image4Map">
<area shape="rect" coords="2,2,111,27" href="#">
</map>
<map name="Image5Map">
<area shape="rect" coords="3,2,111,26" href="#">
</map>
</p>
</body>
</html>
Anden fil (validering_kokken.asp) er den validering der kaldes og hvor jeg ønsker teksteren ændret i pop_up'erne;
function validering()
{
if (new_comment.navn.value == " ")
alert('Husk at indtaste en overskrift!')
else
{
error = 0;
placering=0;
tekst=(new_comment.email.value).toLowerCase();
placering=tekst.indexOf("@");
if(tekst ==""){
alert ("You must type in your e-mail!");
error = 1;
}
else{
tegn=tekst.indexOf(" ");
if(tegn!=-1){
alert ("Space can not be used in your e-mail address!");
error = 1;
}
else{
if (tekst.indexOf("æ")!=-1 || tekst.indexOf("ø")!=-1 || tekst.indexOf("å")!=-1 ||
tekst.indexOf("Æ")!=-1 || tekst.indexOf("Ø")!=-1 || tekst.indexOf("Å")!=-1 ||
tekst.indexOf(";")!=-1 || tekst.indexOf(",")!=-1){
alert ("These characters æ ø å Æ Ø Å , ; can not be used in your e-mail address!");
error = 1;
}
else{
if (placering<1 || tekst.length<=(placering+1)){
alert ("Your e-mail address is wrong - try again!");
error = 1;
}
}
}
}
if(error == 0)
new_comment.submit();
}
}
Tredje fil (add_kokken.asp) tilføjer det ønskede;
<%
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
strMode = request.form("strMode")
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If strMode <> "new_comment" then
'Redirect to user start page
Response.Redirect "index.asp"
End If
'Dimension variables
Dim strInputComments 'Holds the Users comments
Dim saryCommentWord 'Array to hold each word in the comments enetred by the user
Dim intCheckWordLengthLoopCounter 'Loop counter
Dim intWordLength 'Holds the length of the word to be checked
Dim blnWordLenthOK 'Boolean set to False if any words in the description are above 80 characters
Dim intLongestWordLength 'Holds the number of characters in the longest word entered in the
'Read in user deatils from the kokken (DB users.db) form
strInputComments = Request.Form("text")
'Split-up each word in the comments from the user to check that no word entered is over 50 characters
saryCommentWord = Split(Trim(strInputComments), " ")
'Initialse the word length variable
blnWordLenthOK = True
'Loop round to check that each word in the comments entered by the user is not above 70 characters
For intCheckWordLengthLoopCounter = 0 To UBound(saryCommentWord)
'Initialise the intWordLength variable with the length of the word to be searched
intWordLength = Len(saryCommentWord(intCheckWordLengthLoopCounter))
'Get the number of characters in the longest word
If intWordLength => intLongestWordLength Then
intLongestWordLength = intWordLength
End If
'If the word length to be searched is more than or equal to 70 then set the blnWordLegthOK to false
If intWordLength => 80 Then
blnWordLenthOK = False
End If
Next
If blnWordLenthOK = True Then
Set Rs = Server.CreateObject ("ADODB.Connection")
set rec = server.createobject("ADODB.recordset")
Rs.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("../Systematic/users.mdb")
Rec.open "kokken", Rs, 2, 3
Dim dato
dato = date()
Dim tid
tid = time()
navn = Request ("navn")
email = Request ("email")
comment = Request ("text")
if comment = "" then
comment = "Der er ikke skrevet nogen kommentar!"
end if
Rec.Addnew
Rec("nick") = navn
Rec("email") = email
Rec("text") = comment
Rec("dato") = dato
Rec("tid") = tid
REC.Update
Rec.close
set Rec=nothing
Response.redirect "kokkenet.asp"
else
Session("error") = true
Session("message") = "Beklager, det er ikke lovligt at taste over 70 tegn!"
Response.redirect "sign_kokken.asp"
end if
%>
Håber ikke, det virker for forvirrende?
Hilsen Dolly
