03. november 2003 - 09:47Der er
4 kommentarer og 1 løsning
Fjerne validering
Hej! Jeg ville meget gerne, hvis der er en, der kan hjælpe mig med at fjerne valideringen på denne side. Jeg har prøvet flere forskellige ting, men endnu uden held. Det, der sker for mig hver gang, er, at sitet bliver passivt eller melder en fejl for mig.
Mine koder er som følgende;
sign_opskrift (dette er min formular):
<!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>
'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 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, men det er ikke lovligt at taste over 70 tegn!" Response.redirect "sign_kokken.asp" end if %>
kokkenet.asp (her skal DB'en vises):
<!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"> <style type="text/css"> <!-- @import url("systematic.css"); --> </style>
Hvis du helt vil fjerne functionen "validering()" skal du også fjerne den de steder, hvor den bliver kaldt. Med andre ord: fjern attributten 'onClick="validering()' fra HTML koden også.
'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 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, men det er ikke lovligt at taste over 70 tegn!" Response.redirect "sign_kokken.asp" end if %>
kokkenet.asp (her skal DB'en vises):
<!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"> <style type="text/css"> <!-- @import url("systematic.css"); --> </style>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.