Avatar billede duno Nybegynder
28. marts 2004 - 11:38 Der er 1 løsning

Min browser går ned når jeg åbner denne kode

Hvergang jeg åbner siden lukker min browser...

jeg vedlægger koden her



<% Option Explicit %>
<!--#include file="common.asp" -->
<%

'Reset Server Variables
Set rsCommon = Nothing   
adoCon.Close
Set adoCon = Nothing

%>
<html>
<head>
<title>BHN Webdesign</title>
<style type="text/css">
<!--
#divUpControl{position:absolute; top:35; left:230; visibility:visible; z-index:25;}
#divDownControl{position:absolute; top:35; left:245; visibility:visible; z-index:25;}
#divContainer{position:absolute; width:250; height:350; overflow:hidden; top:150; left:16; clip:rect(0,400,330,0); visibility:hidden}
#divContent{position:absolute; top:10; left:0}
.noline {  text-decoration: none}
-->

<LINK REL="stylesheet" HREF="newstyle_ns.css" MEDIA="screen">
<LINK REL="stylesheet" HREF="newstyle.css" MEDIA="screen,foo">

a:hover {  }
a:hover {  color: #000000; text-decoration: underline}
</style>
<script language="JavaScript" src="scroll.js"></script>
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
<script language="javascript" type="text/javascript">
<!--
<!--var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
//-->
</script>
<script  language="JavaScript">
<!-- Hide from older browsers...

//Function to check form is filled in correctly before submitting
function CheckForm () {

    //Intialise variables
    var errorMsg = "";
    var errorMsgLong = "";

    //Check for a name
    if (document.frmSignGuestBook.name.value == ""){
        errorMsg += "\n\tNavn \t\t- Skriv dit navn";
    }
   
    //Check for a country
    if (document.frmSignGuestBook.country.value == "0"){
        errorMsg += "\n\tForbindelse \t- Vælg forbindelse";
    }
   
    //Check for comments
    if (document.frmSignGuestBook.comments.value == ""){
        errorMsg += "\n\tBesked \t\t- Udfyld besked";
    }
   
    //Check the description length before submiting the form   
    if (document.frmSignGuestBook.comments.value.length > 10000){
        errorMsgLong += "\n- Your comments are " + document.frmSignGuestBook.comments.value.length + " chracters long, they need to be shortned to below <% = intMsgCharNo %> chracters.";
    }
   
    //Check the word length before submitting
    words = document.frmSignGuestBook.comments.value.split(' ');
    for (var loop = 0; loop <= words.length - 1; ++loop){
        if (words[loop].length >= 50){
        errorMsgLong += "\n- A word in your comments contains " + words[loop].length + " characters, this needs to be shortened to below 50 characters.";
        }   
    }   
       
    //Check for HTML tags before submitting the form   
    for (var count = 0; count <= 7; ++count){
        if ((document.frmSignGuestBook.elements[count].value.indexOf("<", 0) >= 0) && (document.frmSignGuestBook.elements[count].value.indexOf(">", 0) >= 0)){
            errorMsgLong += "\n- HTML tags are not permitted, remove all HTML tags.";
        }           
    }
   
    //If there is aproblem with the form then display an error
    if ((errorMsg != "") || (errorMsgLong != "")){
        msg = "___________________________________________________________________\n\n";
        msg += "Din hilsen er ikke gemt, fordi der stadig er tomme felter.\n";
        msg += "Udfyld venligst alle felter.\n";
        msg += "___________________________________________________________________\n\n";
        msg += "Følgende felt(er) mangler at blive udfyldt: -\n";
       
        errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
        return false;
    }
   
    return true;
}

//Function to count the number of characters in the description text box
function DescriptionCharCount() {
    document.frmSignGuestBook.countcharacters.value = document.frmSignGuestBook.comments.value.length;   
}

// Function to add the code for bold italic and underline, to the message
function AddMessageCode(code,promptText, InsertText) {

    if (code != "") {
        insertCode = prompt(promptText + "\n[" + code + "]xxx[/" + code + "]", InsertText);
            if ((insertCode != null) && (insertCode != "")){
                document.frmSignGuestBook.comments.value += "[" + code + "]" + insertCode + "[/"+ code + "] ";
            }
    }       
    document.frmSignGuestBook.comments.focus();
}


//Function to add the code to the message for the smileys
function AddSmileyIcon(iconCode) {   
        document.frmSignGuestBook.comments.value += iconCode + " ";
        document.frmSignGuestBook.comments.focus();
}

//Function to open pop up window
function openWin(theURL,winName,features) {
      window.open(theURL,winName,features);
}
// -->
</script>
<style type="text/css">
<!--
.back {  background-attachment: fixed; background-color: #314D6B; background-image: url(billede.jpg); background-repeat: no-repeat; background-position: left top}
-->
</style>
<STYLE type=text/css>

<style type="text/css">
<!--
body  { font-size: 80%; font-family: Verdana, Arial, Helvetica; }
td    { font-size: 80%; font-family: Verdana, Arial, Helvetica; }
-->
</style>
<STYLE TYPE="TEXT/CSS"><!--
.onLoad    {
color:#314D6B;
background:#74879A;
scrollbar-base-color:#314D6B;
    }
//--></STYLE>

</head>


<body bgcolor="#2C4B69" background="grafik/mainback.jpg" class="back" onload="InitialiseScrollableArea();" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" width="260">
    <tr>
      <td class="white1"> <br>
        <br>
      <!-- begin absolutely positioned scrollable area object-->
      <div id="divUpControl" style="left: 743px; top: 11px"> <a href="java script:;" onMouseOver="PerformScroll(-7)" onMouseOut="CeaseScroll()"><img src="arrow_up.gif" tppabs="http://www.yesitworks.com/platsannons/trust2you/images/arrow_up.gif" width=20 height=15 border=0></a>
      </div>
      <div id="divDownControl" style="left: 743px; top: 381px"> <a href="java script:;" onMouseOver="PerformScroll(7)" onMouseOut="CeaseScroll()"><img src="arrow_down.gif" tppabs="http://www.yesitworks.com/platsannons/trust2you/images/arrow_down.gif" width=20 height=15 border=0></a>
      </div>

      <div id="divUpControl" style="left: 4px; top: 11px"> <a href="java script:;" onMouseOver="PerformScroll(-7)" onMouseOut="CeaseScroll()"><img src="arrow_up.gif" tppabs="http://www.yesitworks.com/platsannons/trust2you/images/arrow_up.gif" width=20 height=15 border=0></a>
      </div>
      <div id="divDownControl" style="left: 4px; top: 381px"> <a href="java script:;" onMouseOver="PerformScroll(7)" onMouseOut="CeaseScroll()"><img src="arrow_down.gif" tppabs="http://www.yesitworks.com/platsannons/trust2you/images/arrow_down.gif" width=20 height=15 border=0></a>
      </div>
       
      <div id="divContainer" style="visibility: visible; left: 10px; top: -2px; width: 750; height: 408; clip: rect(0 750 500 0)">
        <div id="divContent" class="white1" style="visibility: visible; left: 0px; top: 21px; width: 740">
<table width="100%" border="0" cellspacing="0" cellpadding="0" vspace="0" hspace="0" height="100%">
  <tr>
    <td width="10">&nbsp;</td>
    <td align="center" valign="top" colspan="2"> <br>
      <span class="heading"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#74879A">Skriv
      i g&aelig;stebogen</font></span><br>

      <form method=post name="frmSignGuestBook" action="add_comments.asp?PagePosition=<% = Server.URLEncode(Request.QueryString("PagePosition")) %>" onSubmit="return CheckForm();" onReset="return confirm('Are you sure you want to Clear the Form?');">
        <table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td width="83%">
              <table width="100%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="<% = strTableBorderColour %>">
                <tr>
                  <td height="280">
                    <table width="100%" border="1" align="center" height="233" bgcolor="#74879A" cellpadding="2" cellspacing="0" bordercolor="#314D6B">
                      <tr align="left">
                        <td colspan="2" class="text" height="30"><b>Felter markeret
                          med en * skal udfyldes</b></td>
                      </tr>
                      <tr>
                        <td align="right" width="24%" height="14" class="text"><b>Navn*:
                          </b></td>
                        <td height="14" width="76%">
                          <input type="text" name="name" size="30" maxlength="30" class="onLoad">
                          </td>
                      </tr>
                      <tr class="arial">
                        <td align="right" width="24%" class="text" height="12"><b>Forbindelse*:</b></td>
                        <td height="12" width="76%">
                          <select name=country class="onLoad">
                            <option value="0" selected>Tryk for at vælge</option>
                            <option>Familie</option>
                            <option>Ven</option>
                            <option>Min-baby.dk</option>
                            <option>Andet</option>
                          </select class="onLoad">
                        </td>
                      </tr>
                      <tr>
                        <td align="right" width="24%" class="text" height="12"><b>E-mail:</b></td>
                        <td height="12" width="76%">
                          <input type="text" name="email" size="30" maxlength="50" class="onLoad">
                        </td>
                      </tr>
                      <tr>
                        <td align="right" width="24%" class="text" height="12"><b>Hjemmeside:</b></td>
                        <td height="12" width="76%">
                          <input type="text" name="homepage" size="30" maxlength="50" value="http://" class="onLoad">
                        </td>
                      </tr>
                      <tr>
                        <td valign="top" align="right" height="31" width="24%" class="text">&nbsp;</td>
                        <td height="31" width="76%" valign="bottom"> </td>
                      </tr>
                      <tr>
                        <td valign="top" align="right" height="124" width="24%" class="text"><b>Besked*:<br>
                          <span style="font-size: 10px;">(max.
                          <% = intMsgCharNo %>
                          tegn)</span></b></td>
                        <td height="124" width="76%" valign="top">
                          <textarea name="comments" cols="40" rows="6" onKeyDown="DescriptionCharCount();" onKeyUp="DescriptionCharCount();" class="onLoad"></textarea>
                        </td>
                      </tr>
                      <tr>
                        <td valign="top" align="right" height="2" width="24%" class="text"><b>Antal
                          tegn : </b></td>
                        <td height="2" width="76%">
                          <input size="5" value="0" name="countcharacters" maxlength="5" class="onLoad">
                          <input onClick="DescriptionCharCount();" type="button" value="T&aelig;l tegn" name="Count" class="onLoad">
                        </td>
                      </tr>
                      <tr>
                        <td valign="top" align="right" height="2" width="24%" class="text">&nbsp;
                        </td>
                        <td height="2" width="76%">
                          <p>
                            <input type="submit" name="Submit" value="Send" class="onLoad">
                            <input type="reset" name="Reset" value="Slet alt" class="onLoad">
                          </p>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </form>
    <td width="10">
      <div align="right"></div>
    </td>
  </tr>
</table>

        </div>
      </div>
</td></tr></table>
</body>
</html>

håber det er til at overskue...

det er 2 forskellige velfungerende scripts sat sammen ala duno...
Avatar billede duno Nybegynder
03. september 2004 - 21:32 #1
nok om det

slut for nu
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