Avatar billede juks Novice
13. juni 2006 - 12:23 Der er 9 kommentarer og
1 løsning

button bliver nogle gange aktiveret ved tryk på space

Hej ,
vi har meget mystisk problem ,vi har et forum og nogle gange når folk skriver bliver "send" knappen aktiveret ved tryk på space , dvs at den laver en ny tråd hver gang man trykker space.

så den poster

j
je
jeg
jeg k
jeg ka
jeg kan

etc.

nogler der ved hvad der kan være galt
Avatar billede fennec Nybegynder
13. juni 2006 - 12:33 #1
Ud fra det viste, er det ikke kun space, men et hvert tastetryk som sender formen...
Har jeg ikke ret i det???
Avatar billede fennec Nybegynder
13. juni 2006 - 12:35 #2
Har du en eller anden onKeyPress funktion på din input form???
Avatar billede juks Novice
15. juni 2006 - 15:05 #3
men det var mig der skrev forkert det er kun ved space..

jeg
jeg kan
jeg kan godt ...
etc.

men jeg mener ikke der er nogen onkeypres nogle steder.

kan sende dig asp filen hvis det hjælper
Avatar billede fennec Nybegynder
15. juni 2006 - 15:30 #4
Hvor mange linjer er der i filen??
Avatar billede juks Novice
16. juni 2006 - 05:31 #5
280
Avatar billede fennec Nybegynder
16. juni 2006 - 08:28 #6
Så bare smid alle linjer herind, eller lav en kopi af filen ude på nettet, omdøb den til .txt og smid et link til den herinde.
Avatar billede juks Novice
19. juni 2006 - 11:03 #7
<%Option Explicit%>
<%
Dim Forum,message_id,message_img,forum_id,message_timestamp,kind,message_time,author_ip
Forum= request.querystring("Forum")
message_id=request.querystring("message_id")
message_img=request.querystring("message_img")

if not Forum="Yes" then
if Session("Loggedin") <> 1 then
  response.write "Access denied, please login first."
  response.end
end if
end if

  Response.Expires = 0
Dim sLoadDoc,thread_parent
Dim sSaveName
dim varaction
dim oConn
dim oRS
dim DSNtemp
dim strSQL
dim varID
dim skrevetDen
dim MiniPic
dim konverter,VarAf
sLoadDoc = " src=""load.asp"""


'open our connection to the DB as a connection called oConn
Set oConn = Server.CreateObject("ADODB.Connection")

oConn.Open DSNtemp

  varAction = request.querystring("doaction")
  varID = request.querystring("ID")
  session("varID")=varID   

if not Forum="Yes" then

    strSQL = "SELECT * FROM 2l WHERE ID= " & varID
    set oRS = oConn.execute(strSQL)
session("title")= oRS("title")
session("doaction")= varAction
session("bodystart")= oRS("bodystart")
session("bodyslut")= oRS("bodyslut")
session("body")= oRS("body")
session("kategori")= oRS("kategori")
session("nyhedNR")= oRS("nyhedNR")
       
session("MiniPic")=oRS("MiniPic")
if len(session("MiniPic"))<1 then    
session("MiniPic")="../img/defaultbillede.gif"
end if
session("skrevetDen")=oRS("skrevetDen")
session("VarAf")=ors("af")
if len(session("VarAf"))<1 then
session("VarAf")=session("fornavn")&" "&session("efternavn")
end if
if len(session("skrevetDen"))<1 then
session("skrevetDen")=(Day(Date))&"/"&(month(Date))&"-"&(year(Date))
end if   

else
author_ip= request.querystring("author_ip")
forum_id= request.querystring("forum_id")
message_timestamp= request.querystring("message_timestamp")
kind= request.querystring("kind")
message_id= request.querystring("message_id")
thread_parent= request.querystring("thread_parent")
message_time= request.querystring("message_time")
'response.write("thread_parent:"&thread_parent)

session("SpcialUpload")="Yes"
session("skrevetDen")=(Day(Date))&"/"&(month(Date))&"-"&(year(Date))
if len(session("skrevetDen"))<1 then
session("skrevetDen")=(Day(Date))&"/"&(month(Date))&"-"&(year(Date))
end if
session("title")= ""
session("doaction")= "Edit"
session("bodystart")= ""
session("bodyslut")= ""
session("body")= ""
session("kategori")= "nyhed"
session("nyhedNR")= ""       
session("MiniPic")="../img/defaultbillede.gif"   
   
session("VarAf")=session("fornavn")&" "&session("efternavn")
end if

%>
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="../global.css" type="text/css">
    <link rel="styleshet" type="text/css" href="../editor.css">
    <script LANGUAGE="JavaScript" src="../editor.js"></script>

<script type="text/javascript">
function openwindow()
{
window.open('../img/uploadform2.asp?id=<%=varID%>','Upload', 'width=550, height=30')
}
</script>
</head>

<body bgcolor="#ffffff"  topmargin="0" leftmargin="0">
<p class="body"></p2>
<!--Editor starts here -->

<form name="editor" method="post" action="save_handler.asp?forum=<%=Forum%>&message_id=<%=message_id%>&message_img=<%=message_img%>&forum_id=<%=forum_id%>&message_timestamp=<%=message_timestamp%>&kind=<%=kind%>&thread_parent=<%=thread_parent%>&message_time=<%=message_time%>&author_ip=<%=author_ip%>">
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#cccccc" align="center">
  <tr>
      <td>Title</td>
      <td><input type="text" name="title" value="<%=session("title")%>" size="33"></font></td>
    </tr>
<%if not Forum="Yes" then%>   
    <tr>
      <td>Bodystart</td>
      <td><textarea rows="2" name="bodystart" cols="53"><%=session("bodystart")%></textarea></td>
    </tr>   
<%end if%>
<tr>
<%if session("doaction")="Konverter" then
session("kategori")="testnyhed"
session("doaction")="nuttin"
end if%>
<%if ((session("kategori")="testnyhed") or (session("kategori")="nyhed"))then%>
<%if not Forum="Yes" then%>
  <tr>
      <td>Kategori</td>
      <td>
<%
if session("kategori")="" then%>
<input type="radio" name="kategori" checked value='' >Alm. side
<%else%>
<input type="radio" name="kategori" value='' >Alm. side
<%end if%>

<%if session("kategori")="testnyhed" then%>
<input type="radio" name="kategori" checked value='testnyhed' >Nyhed
<%else%>
<input type="radio" name="kategori" value='testnyhed' >Nyhed
<%end if%>
<%if session("kategori")="nyhed" then%>
<input type="radio" name="kategori" checked value='nyhed' >Offentligjort nyhed
<%else%>
<input type="radio" name="kategori" value='nyhed' >Offentligjort nyhed
<%
session("nyhedNR")=session("MaXnyhedNR")
end if

end if
end if%>
&nbsp;</td>
</tr>


<%if ((session("kategori")="testnyhed") or (session("kategori")="nyhed"))then%>
    <tr>
      <td>Skrevet af:</td>
      <td><input type="text" name="varaf" value="<%=session("VarAf")%>" size="33"></td>
    </tr>   

    <tr>
      <td>Skrevet Den:</td>
      <td><input type="text" name="skrevetDen" value="<%=session("skrevetDen")%>" size="33"></td>
    </tr>   
<%if not Forum="Yes" then%>
    <tr>
      <td>Minipic</td>
      <td><input type="text" name="Minipic" value="<%=session("Minipic")%>" size="33"></td>
    </tr>   

<%end if
end if%>
      <td>Body</td>

  <td bgcolor="#d2b48c">
  <table border="0" cellpadding="0" cellspacing="0">
  <tr>
      <td align="top" bgcolor="#efedde">
          <table border="0" cellpadding="0" cellspacing="0">
          <tr>
              <td>&nbsp;
              <select onchange="cmdExec('formatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
                  <option selected>Style</option>
                  <option value="Normal">Normal</option>
                  <option value="Heading 1">Heading 1</option>
                  <option value="Heading 2">Heading 2</option>
                  <option value="Heading 3">Heading 3</option>
                  <option value="Heading 4">Heading 4</option>
                  <option value="Heading 5">Heading 5</option>
                  <option value="Address">Address</option>
                  <option value="Formatted">Formatted</option>
                  <option value="Definition Term">Definition Term</option>
              </select>
              <select onchange="cmdExec('fontname',this[this.selectedIndex].value);">
                  <option selected>Font</option>
                  <option value="Arial">Arial</option>
                  <option value="Arial Black">Arial Black</option>
                  <option value="Arial Narrow">Arial Narrow</option>
                  <option value="Comic Sans MS">Comic Sans MS</option>
                  <option value="Courier New">Courier New</option>
                  <option value="System">System</option>
                  <option value="Tahoma">Tahoma</option>
                  <option value="Times New Roman">Times New Roman</option>
                  <option value="Verdana">Verdana</option>
                  <option value="Wingdings">Wingdings</option>
              </select>
              <select onchange="cmdExec('fontsize',this[this.selectedIndex].value);">
                  <option selected>Size</option>
                  <option value="1">1</option>
                  <option value="2">2</option>
                  <option value="3">3</option>
                  <option value="4">4</option>
                  <option value="5">5</option>
                  <option value="6">6</option>
                  <option value="7">7</option>
                  <option value="8">8</option>
                  <option value="10">10</option>
                  <option value="12">12</option>
                  <option value="14">14</option>
              </select>
              </td>
                  <td nowrap height="22">&nbsp; <img hspace="1" vspace="1" align=absmiddle src="../images/imageUpload.gif" alt="Upload Images" onClick="uploadImages()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/imageLocal.gif" alt="Insert Local Image" onClick="insertImageLocal()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/imageLink.gif" alt="Insert Link to External Image" onClick="insertImageLink()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Link.gif" alt="Insert Link" onClick="cmdExec('createLink')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/table.gif" alt="Insert Table" onClick="tableDialog()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          &nbsp; </td>
          </tr>
          </table>
          <table border="0" cellpadding="0" cellspacing="0">
          <tr>
                  <td nowrap height="22">&nbsp; <img hspace="1" vspace=1 align=absmiddle src="../images/Cut.gif" alt="Cut" onClick="cmdExec('cut')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Copy.gif" alt="Copy" onClick="cmdExec('copy')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Paste.gif" alt="Paste" onClick="cmdExec('paste')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Undo.gif" alt="Undo" onClick="cmdExec('Undo')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Bold.gif" alt="Bold" onClick="cmdExec('bold')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Italic.gif" alt="Italics" onClick="cmdExec('italic')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/under.gif" alt="Underline" onClick="cmdExec('underline')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Strikethrough.gif" alt="Strike-through" onClick="cmdExec('StrikeThrough')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Superscript.gif" alt="Superscript" onClick="cmdExec('SuperScript')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Subscript.gif" alt="Subscript" onClick="cmdExec('SubScript')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/left.gif" alt="Justify Left" onClick="cmdExec('justifyleft')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/Center.gif" alt="Center" onClick="cmdExec('justifycenter')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/right.gif" alt="Justify Right" onClick="cmdExec('justifyright')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/numlist.gif" alt="Ordered List" onClick="cmdExec('insertorderedlist')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/bullist.gif" alt="Unordered List" onClick="cmdExec('insertunorderedlist')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">

                          <img hspace="1" vspace=1 align=absmiddle src="../images/inindent.gif" alt="Increase Indent" onClick="cmdExec('indent')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/outdent.gif" alt="Decrease Indent" onClick="cmdExec('outdent')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/HR.gif" alt="Insert Horizontal Rule" onClick="cmdExec('InsertHorizontalRule')" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          <img hspace="1" vspace=1 align=absmiddle src="../images/fgcolor.gif" alt="Forecolor" onClick="foreColor()" onmouseover="button_over(this);" onmouseout="button_out(this);" onmousedown="button_down(this);" onmouseup="button_up(this);">
                          &nbsp;</td>
          </tr>
          </table>
      </td>
  </tr>
  <tr>
              <td><iframe width="533" id="idContent" height="280"<%=sLoadDoc%>></iframe></td>
        </td>

  </tr>
  <tr>
      <td bgcolor="#efedde" align="right">
          <table border="0" cellpadding="0" cellspacing="0" align="left">
          <tr>
              <td class="body"><%if not Forum="Yes" then%><input type="checkbox" onclick="setMode(this.checked)">Edit HTML
              &nbsp;<%end if%>
              <input name="YOUR_CONTENT" type="hidden" value="">
            <input name="DOSAVE" type="hidden" value="true">
              <input name="FILE_NAME" type="hidden" value="<%=sSaveName%>"></td>
            <input name="thread_parent" type="hidden" value="<%=thread_parent%>">
          </tr>

          </table>
      <input type="button" name="Submit" value="Gem &raquo;" onclick="SubmitContent('true');">&nbsp;<input type="button" name="Cancel" value="Cancel &raquo;" onclick="SubmitContent('false');">
      </td>
  </tr>
  </table>
</td>
</tr>
<%if not Forum="Yes" then%>
    <tr>
      <td>Bodyslut</td>
      <td><textarea rows="2" name="Bodyslut" cols="53"><%=session("Bodyslut")%></textarea></td>
    </tr>
<%end if%>
</table>
</form>
<!-- editor ends here -->
<p>&nbsp;</p>
</body>
</html>
Avatar billede juks Novice
26. juni 2006 - 16:33 #8
anyone
Avatar billede fennec Nybegynder
27. juni 2006 - 08:51 #9
Havde helt glemt ?'et. Det må du undskylde...

Jeg kan ikke se noget kode til at gemme i databasen. Ligger det i en anden fil, for så skal jeg lige have den også.

Hvad er det for en HTML editor du bruger?? For problemet kan godt ligger heri...
Avatar billede juks Novice
13. december 2007 - 10:51 #10
dårligt cms system
Avatar billede Ny bruger Nybegynder

Din løsning...

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.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester