Avatar billede python Nybegynder
12. november 1999 - 01:12 Der er 5 kommentarer og
1 løsning

Kan ikke forstå at textfielden går ud af focus

paster lige kode .. kig i bunden for spørgsmål ..
--------
<%
If Request.Form("message") <> "" Then
strMessage = Trim(Request.Form("message"))
if strMessage <>"" then
strMessage = CStr(Replace(strMessage,"'","`"))
strMessage = CStr(Replace(strMessage,"<","&lt;"))
strMessage = CStr(Replace(strMessage,">","&gt;"))
strMessage = CStr(Replace(strMessage,":)","<img src=images/smiley1.gif>"))
strMessage = CStr(Replace(strMessage,";)","<img src=images/smiley2.gif>"))
strMessage = CStr(Replace(strMessage,":(","<img src=images/smiley3.gif>"))
strMessage = CStr(Replace(strMessage,":|","<img src=images/smiley4.gif>"))
strMessage = CStr(Replace(strMessage,":@","<img src=images/smiley5.gif>"))
strMessage = CStr(Replace(strMessage,":?","<img src=images/smiley6.gif>"))
strMessage = CStr(Replace(strMessage,":!","<img src=images/smiley7.gif>"))
strMessage = CStr(Replace(strMessage,":*","<img src=images/smiley9.gif>"))
End If

If Not Request.Form("message")="" THEN
APPLICATION.LOCK
Application("txt30") = Application("txt29")
Application("txt29") = Application("txt28")
Application("txt28") = Application("txt27")
Application("txt27") = Application("txt26")
Application("txt26") = Application("txt25")
Application("txt25") = Application("txt24")
Application("txt24") = Application("txt23")
Application("txt23") = Application("txt22")
Application("txt22") = Application("txt21")
Application("txt21") = Application("txt20")
Application("txt20") = Application("txt19")
Application("txt19") = Application("txt18")
Application("txt18") = Application("txt17")
Application("txt17") = Application("txt16")
Application("txt16") = Application("txt15")
Application("txt15") = Application("txt14")
Application("txt14") = Application("txt13")
Application("txt13") = Application("txt12")
Application("txt12") = Application("txt11")
Application("txt11") = Application("txt10")
Application("txt10") = Application("txt9")
Application("txt9") = Application("txt8")
Application("txt8") = Application("txt7")
Application("txt7") = Application("txt6")
Application("txt6") = Application("txt5")
Application("txt5") = Application("txt4")
Application("txt4") = Application("txt3")
Application("txt3") = Application("txt2")
Application("txt2") = Application("txt1")
Application("txt1") = "<font face=Verdana size=2 color=" & Session("color") & "><b>" & Session("chatname") & "<font face=Verdana size=1>&nbsp;" & time() & "</b>: <font face=Verdana size=2>" & strMessage & "</font>"
APPLICATION.UNLOCK
End If
End If
%>

<html>

<head>
<title></title>
</head>

<body bgcolor="#000080" text="#00FFFF" vlink="#66FF33" link="#FFFF00" alink="#006600">
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openWindow(url, name) {
  popupWin = window.open(url, name, 'width=480,height=300')
}
// done hiding -->
</script>
<form method="POST" action="send.asp" target="Bottom">
<input type="text" name="message" size="57">&nbsp;&nbsp;<a href="java script:openWindow('help.htm', 'remote');">Help</a>
</form>
</body>

Det er den skide textfield, den går ud a focus hver gang jeg sender en msg. altså jeg skal trykke i den HVER gang jeg skal sende en ny besked .. nogen der ved hvad der er galt ?

btw. Selve chatten + source code kan i finde på www.chatin.dht.dk
Avatar billede one Nybegynder
12. november 1999 - 01:31 #1
kan  få det til at virke for  60 point  (=

Andreas
Avatar billede kichian Nybegynder
12. november 1999 - 05:58 #2
tilføj JavaScriptkode der i onload-eventen sætter fokus på tekstfeltet.
Avatar billede one Nybegynder
12. november 1999 - 06:15 #3
<%
If Request.Form("message") <> "" Then
strMessage = Trim(Request.Form("message"))
if strMessage <>"" then
strMessage = CStr(Replace(strMessage,"'","`"))
strMessage = CStr(Replace(strMessage,"<","&lt;"))
strMessage = CStr(Replace(strMessage,">","&gt;"))
strMessage = CStr(Replace(strMessage,":)","<img src=images/smiley1.gif>"))
strMessage = CStr(Replace(strMessage,";)","<img src=images/smiley2.gif>"))
strMessage = CStr(Replace(strMessage,":(","<img src=images/smiley3.gif>"))
strMessage = CStr(Replace(strMessage,":|","<img src=images/smiley4.gif>"))
strMessage = CStr(Replace(strMessage,":@","<img src=images/smiley5.gif>"))
strMessage = CStr(Replace(strMessage,":?","<img src=images/smiley6.gif>"))
strMessage = CStr(Replace(strMessage,":!","<img src=images/smiley7.gif>"))
strMessage = CStr(Replace(strMessage,":*","<img src=images/smiley9.gif>"))
End If

If Not Request.Form("message")="" THEN
APPLICATION.LOCK
Application("txt30") = Application("txt29")
Application("txt29") = Application("txt28")
Application("txt28") = Application("txt27")
Application("txt27") = Application("txt26")
Application("txt26") = Application("txt25")
Application("txt25") = Application("txt24")
Application("txt24") = Application("txt23")
Application("txt23") = Application("txt22")
Application("txt22") = Application("txt21")
Application("txt21") = Application("txt20")
Application("txt20") = Application("txt19")
Application("txt19") = Application("txt18")
Application("txt18") = Application("txt17")
Application("txt17") = Application("txt16")
Application("txt16") = Application("txt15")
Application("txt15") = Application("txt14")
Application("txt14") = Application("txt13")
Application("txt13") = Application("txt12")
Application("txt12") = Application("txt11")
Application("txt11") = Application("txt10")
Application("txt10") = Application("txt9")
Application("txt9") = Application("txt8")
Application("txt8") = Application("txt7")
Application("txt7") = Application("txt6")
Application("txt6") = Application("txt5")
Application("txt5") = Application("txt4")
Application("txt4") = Application("txt3")
Application("txt3") = Application("txt2")
Application("txt2") = Application("txt1")
Application("txt1") = "<font face=Verdana size=2 color=" & Session("color") & "><b>" & Session("chatname") & "<font face=Verdana size=1>&nbsp;" & time() & "</b>: <font face=Verdana size=2>" & strMessage & "</font>"
APPLICATION.UNLOCK
End If
End If
%>

<html>

<head>
<title></title>
</head>

<body bgcolor="#000080" text="#00FFFF" vlink="#66FF33" link="#FFFF00" alink="#006600">
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openWindow(url, name) {
  popupWin = window.open(url, name, 'width=480,height=300')
}
// done hiding -->
</script>

<form method="POST" action="send.asp" target="Bottom" name="send">
<input type="text" name="message" size="57" name="text">&nbsp;&nbsp;<a href="java script:openWindow('help.htm', 'remote');">Help</a>
</form>
</body>


<SCRIPT LANGUAGE="JavaScript">
document.send.text.focus();
document.send.text.select();
</SCRIPT>



så skulle den være der 

Andreas
Avatar billede one Nybegynder
12. november 1999 - 06:16 #4
<SCRIPT LANGUAGE="JavaScript">
document.send.text.focus();
document.send.text.select();
</SCRIPT>



skal lige ind i body
Avatar billede python Nybegynder
12. november 1999 - 13:51 #5
tak for det ;) .. okay one du skal nok få nogle points en gang ;)
Avatar billede one Nybegynder
12. november 1999 - 22:05 #6
ok takker
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