Avatar billede gummisko Nybegynder
05. oktober 2005 - 10:41 Der er 6 kommentarer

Husk at gemme dine ændringer alert boks

Hejsa
Har en formular med en masse felter af alle slags og en submitknap(for at gemme i database) og en retur-til-forrige-side-knap.
Når brugeren har lavet ændringer i et eller flere af felterne, skal jeg have en alert boks frem, hvis de har glemt at klikke på submitknappen og dermed har gemt ændringerne i formularen.
Ellers går alle ændringer tabt.

æh, hvordan er det lige man gør det???

vh
BM
Avatar billede jonashn Nybegynder
05. oktober 2005 - 20:44 #1
Du mener, at når de klikker på retur-til-forrige-side-knappen skal der komme en box der minder om at man skal gemme, HVIS altså man har ændret et eller flere felter?
Hvis ja, så er det lettest hvis du poster din kode.
Avatar billede gummisko Nybegynder
07. oktober 2005 - 08:34 #2
Den kommer her:

<%@LANGUAGE="VBSCRIPT"%>   
<%
        If Not Session("Adgang") = "Godkendt" Then
            Response.Redirect("login.asp?valg=forbudt")
        End If
    %>

<!--#include file="../Connections/firma.asp" -->
<%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables

If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then

  MM_editConnection = MM_firma_STRING
  MM_editTable = "firma"
  MM_editColumn = "id"
  MM_recordId = "" + Request.Form("MM_recordId") + ""
  MM_editRedirectUrl = "vis.asp"
  MM_fieldsStr  = "checkbox1|value|checkbox2|value|checkbox3|value|checkboxEI|value|checkbox4|value|checkbox5|value|checkbox6|value|checkbox6a|value|checkbox7|value|checkbox8|value|navn|value|adresse|value|post|value|web|value|telefon|value|sidstekontakt|value|generelt|value|kontaktfirma1a|value|kontaktfirma1b|value|kontaktfirma1c|value|kontaktfirma1d|value|kontaktfirma2a|value|kontaktfirma2b|value|kontaktfirma2c|value|kontaktfirma2d|value|kontaktfirma3a|value|kontaktfirma3b|value|kontaktfirma3c|value|kontaktfirma3d|value|kontaktfirma4a|value|kontaktfirma4b|value|kontaktfirma4c|value|kontaktfirma4d|value|kontaktfirma5a|value|kontaktfirma5b|value|kontaktfirma5c|value|kontaktfirma5d|value|kontaktfirma6a|value|kontaktfirma6b|value|kontaktfirma6c|value|kontaktfirma6d|value|beskriv|value|samarbejde1|value|samarbejde2|value|samarbejde3|value|samarbejde4|value|samarbejde5|value|samarbejde6|value|ønsker|value|ønskerbeskriv|value|eamvkontakt1|value|eamvkontakt2|value|eamvkontakt3|value|eamvkontakt4|value|eamvkontakt5|value|eamvkontakt6|value|eamvkontakt7|value|eamvkontakt8|value|eamvkontakt9|value|eamvkontakt10|value|givetlov|value"
  MM_columnsStr = "Administrationsøkonom|none,1,0|Byggetekniker|none,1,0|Datamatiker|none,1,0|EIntegrator|none,1,0|Finansøkonom|none,1,0|Laborant|none,1,0|Markedsføringsøkonom_Viborg|none,1,0|Markedsføringsøkonom_Thisted|none,1,0|Procesteknolog|none,1,0|Produktionsteknolog|none,1,0|navn|',none,''|adresse|',none,''|postnr|',none,''|web|',none,''|telefon|',none,''|sidstekontakt|',none,''|generelt|',none,''|kontaktfirma1a|',none,''|kontaktfirma1b|',none,''|kontaktfirma1c|',none,''|kontaktfirma1d|',none,''|kontaktfirma2a|',none,''|kontaktfirma2b|',none,''|kontaktfirma2c|',none,''|kontaktfirma2d|',none,''|kontaktfirma3a|',none,''|kontaktfirma3b|',none,''|kontaktfirma3c|',none,''|kontaktfirma3d|',none,''|kontaktfirma4a|',none,''|kontaktfirma4b|',none,''|kontaktfirma4c|',none,''|kontaktfirma4d|',none,''|kontaktfirma5a|',none,''|kontaktfirma5b|',none,''|kontaktfirma5c|',none,''|kontaktfirma5d|',none,''|kontaktfirma6a|',none,''|kontaktfirma6b|',none,''|kontaktfirma6c|',none,''|kontaktfirma6d|',none,''|beskriv|',none,''|samarbejde1|none,'Y','N'|samarbejde2|none,'Y','N'|samarbejde3|none,'Y','N'|samarbejde4|none,'Y','N'|samarbejde5|none,'Y','N'|samarbejde6|',none,''|ønsker|none,'Y','N'|ønskerbeskriv|',none,''|eamvkontakt1|',none,''|eamvkontakt2|',none,''|eamvkontakt3|',none,''|eamvkontakt4|',none,''|eamvkontakt5|',none,''|eamvkontakt6|',none,''|eamvkontakt7|',none,''|eamvkontakt8|',none,''|eamvkontakt9|',none,''|eamvkontakt10|',none,''|givetlov|none,none,NULL"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
 
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next

  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End If
  End If

End If
%>
<%
' *** Update Record: construct a sql update statement and execute it

If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then

  ' create the sql update statement
  MM_editQuery = "update " & MM_editTable & " set "
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_editQuery = MM_editQuery & ","
    End If
    MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
  Next
  MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

  If (Not MM_abortEdit) Then
    ' execute the update
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
%>
<%
Dim Recordset1__a
Recordset1__a = "1"
If (Request("id") <> "") Then
  Recordset1__a = Request("id")
End If
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_firma_STRING
Recordset1.Source = "SELECT *  FROM firma  WHERE id = " + Replace(Recordset1__a, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0

%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_firma_STRING
Recordset2.Source = "SELECT adresse  FROM bm"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>
<%
Dim Recordset3__a
Recordset3__a = "bm"
If (session("user") <> "") Then
  Recordset3__a = session("user")
End If
%>
<%
Dim Recordset3__b
Recordset3__b = "bm"
If (Recordset1.Fields.Item("navn").Value <> "") Then
  Recordset3__b = Recordset1.Fields.Item("navn").Value
End If
%>
<%
Dim Recordset3
Dim Recordset3_numRows

Set Recordset3 = Server.CreateObject("ADODB.Recordset")
Recordset3.ActiveConnection = MM_firma_STRING
Recordset3.Source = "SELECT *  FROM notater  WHERE bruger= '" + Replace(Recordset3__a, "'", "''") + "' AND firma= '" + Replace(Recordset3__b, "'", "''") + "'"
Recordset3.CursorType = 0
Recordset3.CursorLocation = 2
Recordset3.LockType = 1
Recordset3.Open()

Recordset3_numRows = 0
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Recordset3_total
Dim Recordset3_first
Dim Recordset3_last

' set the record count
Recordset3_total = Recordset3.RecordCount

' set the number of rows displayed on this page
If (Recordset3_numRows < 0) Then
  Recordset3_numRows = Recordset3_total
Elseif (Recordset3_numRows = 0) Then
  Recordset3_numRows = 1
End If

' set the first and last displayed record
Recordset3_first = 1
Recordset3_last  = Recordset3_first + Recordset3_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset3_total <> -1) Then
  If (Recordset3_first > Recordset3_total) Then
    Recordset3_first = Recordset3_total
  End If
  If (Recordset3_last > Recordset3_total) Then
    Recordset3_last = Recordset3_total
  End If
  If (Recordset3_numRows > Recordset3_total) Then
    Recordset3_numRows = Recordset3_total
  End If
End If
%>

<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Recordset3_total = -1) Then

  ' count the total records by iterating through the recordset
  Recordset3_total=0
  While (Not Recordset3.EOF)
    Recordset3_total = Recordset3_total + 1
    Recordset3.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Recordset3.CursorType > 0) Then
    Recordset3.MoveFirst
  Else
    Recordset3.Requery
  End If

  ' set the number of rows displayed on this page
  If (Recordset3_numRows < 0 Or Recordset3_numRows > Recordset3_total) Then
    Recordset3_numRows = Recordset3_total
  End If

  ' set the first and last displayed record
  Recordset3_first = 1
  Recordset3_last = Recordset3_first + Recordset3_numRows - 1
 
  If (Recordset3_first > Recordset3_total) Then
    Recordset3_first = Recordset3_total
  End If
  If (Recordset3_last > Recordset3_total) Then
    Recordset3_last = Recordset3_total
  End If

End If
%>

<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<title>Navn:</title>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' skal indeholde en e-mailadresse.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' skal anføres.\n'; }
  } if (errors) alert('Følgende fejl opstod:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

<style type="text/css">
<!--
.style1 {font-family: Verdana}
body,td,th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
}
.select {
    width: 200px;
}
-->
</style>
<script type="text/javascript">
var arrFlag=new Array();
window.onload=function(){
  for(i=0;i<document.forms[0].elements.length;i++){
    if(document.forms[0].elements[i].type=="text"||document.forms[0].elements[i].type=="textarea"||document.forms[0].elements[i].type=="file"){
      document.forms[0].elements[i].onchange=function(){
        arrFlag[this.name]=(this.value!=this.defaultValue);
        this.form.elements['SUBMITKNAP'].disabled=!checkFlag();
      }
    }
    if(document.forms[0].elements[i].type=="checkbox"||document.forms[0].elements[i].type=="radio"){
      document.forms[0].elements[i].onchange=function(){
        arrFlag[this.name]=(this.defaultChecked)?!this.checked:this.checked;
        this.form.elements['SUBMITKNAP'].disabled=!checkFlag();
      }
    }
    if(document.forms[0].elements[i].type=="select-one"){
      document.forms[0].elements[i].onchange=function(){
        for(selOpt=o=0;o<this.options.length;o++)if(this.options[o].defaultSelected)selOpt=o;
        arrFlag[this.name]=selOpt!=this.selectedIndex;
        this.form.elements['SUBMITKNAP'].disabled=!checkFlag();
      }
    }
    if(document.forms[0].elements[i].type=="select-multiple"){
      document.forms[0].elements[i].onchange=function(){
        for(selOpt1=selOpt2="",o=0;o<this.options.length;o++){
          if(this.options[o].defaultSelected)selOpt1+=o+"|";
          if(this.options[o].selected)selOpt2+=o+"|";
        }
        arrFlag[this.name]=selOpt1!=selOpt2;
        this.form.elements['SUBMITKNAP'].disabled=!checkFlag();
      }
    }
  }
}
function checkFlag(){
  for(field in arrFlag){
    if(arrFlag[field]) return true;
  }
  return false;
}
</script>
<link href="style/style.css" rel="stylesheet" type="text/css">
</head>
<body lang=DA>
<table width="100%" border="1" align="center" cellspacing="10">
  <tr>
    <td>

  <table width="980" border=0 cellpadding=0 cellspacing=0 bgcolor="#FFFFFF">
    <tr>
      <td colspan="5" valign=top bgcolor="#FFFFFF" >
        <p><img src="billeder/top.jpg" width="980" height="58"></p>
       
    <% if     Recordset3_total = 0 then %>
       
        <form action="notater.asp" method="post" name="form2">
          <input name="firma" type="hidden" value="<%=(Recordset1.Fields.Item("navn").Value)%>">
          <input name="id" id="id" type="hidden" value="<%=(Recordset1.Fields.Item("id").Value)%>">         
          <input name="bruger" type="hidden" value="<%= Session("user")%>">
          <input name="Submit" type="submit" value="Opret dine personlige notater om denne virksomhed"  style="font:10pt Arial; border:1 solid darkblue;cursor:hand;background:#66CCFF" >
              </form>
    <% else %>   
                <form action="notater2.asp" method="post" name="form3" >
          <input name="firma" type="hidden" value="<%=(Recordset1.Fields.Item("navn").Value)%>">
          <input name="id" type="hidden" value="<%=(Recordset1.Fields.Item("id").Value)%>">                 
          <input name="bruger" type="hidden" value="<%= Session("user")%>">
          <input name="Submit" type="submit" value="Dine personlige notater om denne virksomhed" style="font:10pt Arial; border:1 solid darkblue;cursor:hand;background:#66CCFF" >
                      </form>
    <% end if %>   
        <p><font size="4" face="Tahoma, Verdana">Skema til registrering af virksomhedskontakter for
        Erhvervsakademi MidtVest </font></p>
      </td>
    </tr>
    </table>
   
    <form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1" id="2" onSubmit="MM_validateForm('navn','','R','adresse','','R','telefon','','R','beskriv','','R');return document.MM_returnValue" OnChange="document.form.submitknap.disabled = false" OnKeyPress="document.form.submitknap.disabled = false">
    <table border="1">
      <tr>

      <td width=143 rowspan="10" valign=top bgcolor="#D9D9D9" >
        <p ><strong><font size="2"><span style='font-family:Verdana'>Tilknyttede uddannelser:</span></font></strong></p>
      </td>
      <td valign=top > <font size="2" face="Tahoma, Verdana">Administrations&oslash;konom</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Administrationsøkonom").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkbox1" type="checkbox" id="checkbox1" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana"><strong><font face="Tahoma, Verdana" size="2">Navn:</font></strong>
          <input name="navn" type="text" id="navn" value="<%=(Recordset1.Fields.Item("navn").Value)%>" size="40"  >
</font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Byggetekniker</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Byggetekniker").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkbox2" type="checkbox" id="checkbox2" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana"><strong><font size="2"><span style='font-family:Verdana'>Adresse</span></font><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>:</span></font></strong>
          <input name="adresse" type="text" id="adresse" value="<%=(Recordset1.Fields.Item("adresse").Value)%>" size="40">
</font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Datamatiker</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Datamatiker").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkbox3" type="checkbox" id="checkbox3" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana"><strong>Postnr. og by:
            <select class="select" name="post" >
              <option value="value" <%If (Not isNull((Recordset1.Fields.Item("postnr").Value))) Then If ("value" = CStr((Recordset1.Fields.Item("postnr").Value))) Then Response.Write("SELECTED") : Response.Write("")%>><%=(Recordset1.Fields.Item("postnr").Value)%></option>
              <%
While (NOT Recordset2.EOF)
%>
              <option value="<%=(Recordset2.Fields.Item("adresse").Value)%>" <%If (Not isNull((Recordset1.Fields.Item("postnr").Value))) Then If (CStr(Recordset2.Fields.Item("adresse").Value) = CStr((Recordset1.Fields.Item("postnr").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(Recordset2.Fields.Item("adresse").Value)%></option>
              <%
  Recordset2.MoveNext()
Wend
If (Recordset2.CursorType > 0) Then
  Recordset2.MoveFirst
Else
  Recordset2.Requery
End If
%>
            </select>
      </strong>
      </font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">E-Integrator </font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("EIntegrator").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkboxEI" type="checkbox" id="checkboxEI" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana"><strong><font size="2"><span style='font-family:Verdana'>Telefon</span></font><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>:</span></font></strong><font size="2" face="Tahoma, Verdana">
      <input name="telefon" type="text" id="telefon" value="<%=(Recordset1.Fields.Item("telefon").Value)%>" size="30">
      </font>
      </font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Finans&oslash;konom </font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Finansøkonom").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkbox4" type="checkbox" id="checkbox4" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana"><strong><span class="style1"><font size="2">Hjemmeside:</font></span></strong>
          <input name="web" type="text" id="email" value="<%=(Recordset1.Fields.Item("web").Value)%>" size="30">
</font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Laborant</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Laborant").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkbox5" type="checkbox" id="checkbox5" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana">
      <% if Recordset1.Fields.Item("web").Value <> "" then %>
      <a href="http://<%=(Recordset1.Fields.Item("web").Value)%>" target="_blank" class="A1">G&aring; direkte til hjemmesiden her
      </a></font>
      <% end if %>
      </td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Markedsf&oslash;rings&oslash;konom Viborg</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Markedsføringsøkonom_Viborg").Value)) = CStr("1")) Then Response.Write("checked") %> name="checkbox6" type="checkbox" id="checkbox6" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana">&nbsp;
      </font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Markedsf&oslash;rings&oslash;konom Thisted</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Markedsføringsøkonom_Thisted").Value)) = CStr("1")) Then Response.Write("checked") %> name="checkbox6a" type="checkbox" id="checkbox6a" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana">&nbsp;
      </font></td>
    </tr>   
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Procesteknolog</font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Procesteknolog").Value)) = CStr("1")) Then Response.Write("checked") %> name="checkbox7" type="checkbox" id="checkbox7" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana">&nbsp;
      </font></td>
    </tr>
    <tr>
      <td valign=top ><font size="2" face="Tahoma, Verdana">Produktionsteknolog </font></td>
      <td valign=top ><font size="2" face="Tahoma, Verdana">
        <input <%If (CStr((Recordset1.Fields.Item("Produktionsteknolog").Value)) = CStr("1")) Then Response.Write("checked")%> name="checkbox8" type="checkbox" id="checkbox8" value="1">
      </font></td>
      <td colspan="2" valign=top ><font size="2" face="Tahoma, Verdana">&nbsp;
      </font></td>
    </tr>

    <tr>
      <td width="143" valign=top bgcolor="#D9D9D9" >
        <p><strong>Logbog:</strong></p>
      </td>
      <td colspan="4" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana"><strong>Sidste kontakt:</strong>       
          <textarea name="sidstekontakt" cols="25" rows="4" wrap="OFF" id="sidstekontakt"><%=(Recordset1.Fields.Item("sidstekontakt").Value)%></textarea>
          <strong>        Generelle udsendelser(materiale):
          </strong>
          <textarea name="generelt" cols="25" rows="4" wrap="OFF" id="generelt"><%=(Recordset1.Fields.Item("generelt").Value)%></textarea>
        </font></td>
    </tr>
    <tr>
      <td width="143" rowspan="7" valign=top bgcolor="#D9D9D9" ><strong><font size="2"><span style='font-family:Verdana'>Kontaktpersoner firma </span></font><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>:</span></font>
            </strong>
        <p>&nbsp;</p></td>
      <td colspan="4" valign=top bgcolor="white" >Titel:
        <input type="text" name="kontaktfirma1a" id="kontaktfirma1a" value="<%=(Recordset1.Fields.Item("kontaktfirma1a").Value)%>" >
        Navn:
        <input type="text" name="kontaktfirma1b" id="kontaktfirma1b" value="<%=(Recordset1.Fields.Item("kontaktfirma1b").Value)%>" >       
        E-mail:
        <input type="text" name="kontaktfirma1c" id="kontaktfirma1c" value="<%=(Recordset1.Fields.Item("kontaktfirma1c").Value)%>" > 
        Tlf.:
        <input type="text" name="kontaktfirma1d" id="kontaktfirma1d" value="<%=(Recordset1.Fields.Item("kontaktfirma1d").Value)%>" >
        </td>
    </tr>
    <tr>
      <td colspan="4" valign=top bgcolor="white" >Titel:
        <input type="text" name="kontaktfirma2a" id="kontaktfirma2a" value="<%=(Recordset1.Fields.Item("kontaktfirma2a").Value)%>" >
        Navn:
        <input type="text" name="kontaktfirma2b" id="kontaktfirma2b" value="<%=(Recordset1.Fields.Item("kontaktfirma2b").Value)%>" >       
        E-mail:
        <input type="text" name="kontaktfirma2c" id="kontaktfirma2c" value="<%=(Recordset1.Fields.Item("kontaktfirma2c").Value)%>" > 
        Tlf.:
        <input type="text" name="kontaktfirma2d" id="kontaktfirma2d" value="<%=(Recordset1.Fields.Item("kontaktfirma2d").Value)%>" >
        </td>
    </tr>
    <tr>
      <td colspan="4" valign=top bgcolor="white" >Titel:
        <input type="text" name="kontaktfirma3a" id="kontaktfirma3a" value="<%=(Recordset1.Fields.Item("kontaktfirma3a").Value)%>" >
        Navn:
        <input type="text" name="kontaktfirma3b" id="kontaktfirma3b" value="<%=(Recordset1.Fields.Item("kontaktfirma3b").Value)%>" >       
        E-mail:
        <input type="text" name="kontaktfirma3c" id="kontaktfirma3c" value="<%=(Recordset1.Fields.Item("kontaktfirma3c").Value)%>" > 
        Tlf.:
        <input type="text" name="kontaktfirma3d" id="kontaktfirma3d" value="<%=(Recordset1.Fields.Item("kontaktfirma3d").Value)%>" >
        </td>
    </tr>
    <tr>
      <td colspan="4" valign=top bgcolor="white" >Titel:
        <input type="text" name="kontaktfirma4a" id="kontaktfirma4a" value="<%=(Recordset1.Fields.Item("kontaktfirma4a").Value)%>" >
        Navn:
        <input type="text" name="kontaktfirma4b" id="kontaktfirma4b" value="<%=(Recordset1.Fields.Item("kontaktfirma4b").Value)%>" >       
        E-mail:
        <input type="text" name="kontaktfirma4c" id="kontaktfirma4c" value="<%=(Recordset1.Fields.Item("kontaktfirma4c").Value)%>" > 
        Tlf.:
        <input type="text" name="kontaktfirma4d" id="kontaktfirma4d" value="<%=(Recordset1.Fields.Item("kontaktfirma4d").Value)%>" >
        </td>
    </tr>
    <tr>
      <td colspan="4" valign=top bgcolor="white" >Titel:
        <input type="text" name="kontaktfirma5a" id="kontaktfirma5a" value="<%=(Recordset1.Fields.Item("kontaktfirma5a").Value)%>" >
        Navn:
        <input type="text" name="kontaktfirma5b" id="kontaktfirma5b" value="<%=(Recordset1.Fields.Item("kontaktfirma5b").Value)%>" >       
        E-mail:
        <input type="text" name="kontaktfirma5c" id="kontaktfirma5c" value="<%=(Recordset1.Fields.Item("kontaktfirma5c").Value)%>" > 
        Tlf.:
        <input type="text" name="kontaktfirma5d" id="kontaktfirma5d" value="<%=(Recordset1.Fields.Item("kontaktfirma5d").Value)%>" >
        </td>
    </tr>
    <tr>
      <td colspan="4" valign=top bgcolor="white" >Titel:
        <input type="text" name="kontaktfirma6a" id="kontaktfirma6a" value="<%=(Recordset1.Fields.Item("kontaktfirma6a").Value)%>" >
        Navn:
        <input type="text" name="kontaktfirma6b" id="kontaktfirma6b" value="<%=(Recordset1.Fields.Item("kontaktfirma6b").Value)%>" >       
        E-mail:
        <input type="text" name="kontaktfirma6c" id="kontaktfirma6c" value="<%=(Recordset1.Fields.Item("kontaktfirma6c").Value)%>" > 
        Tlf.:
        <input type="text" name="kontaktfirma6d" id="kontaktfirma6d" value="<%=(Recordset1.Fields.Item("kontaktfirma6d").Value)%>" >
        </td>
    </tr>
    <tr>
      <td colspan="4" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">&nbsp;
        </font></td>
    </tr>
        <tr>
      <td width="143" valign=top bgcolor="#D9D9D9" ><strong><font size="2"><span style='font-family:Verdana'>Beskrivelse af firma</span></font><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>:</span></font></strong></td>
      <td colspan="4" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">
        <textarea name="beskriv" cols="50" id="beskriv"><%=(Recordset1.Fields.Item("beskriv").Value)%></textarea>
        </font></td>
      </tr>
    <tr>
      <td width="143" valign=top bgcolor="#D9D9D9" ><strong>Type af samarbejde: </strong></td>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Hovedopgave:
          <input <%If (CStr((Recordset1.Fields.Item("samarbejde1").Value)) = CStr("Y")) Then Response.Write("checked")%> name="samarbejde1" type="checkbox" id="samarbejde1" value="Y">
          <br>
        Praktik:
          <input <%If (CStr((Recordset1.Fields.Item("samarbejde2").Value)) = CStr("Y")) Then Response.Write("checked")%> name="samarbejde2" type="checkbox" id="samarbejde2" value="Y">
          <br>
          G&aelig;stel&aelig;rere:
          <input <%If (CStr((Recordset1.Fields.Item("samarbejde3").Value)) = CStr("Y")) Then Response.Write("checked")%> name="samarbejde3" type="checkbox" id="samarbejde3" value="Y">
          <br>
          </font><font size="2" face="Tahoma, Verdana">&nbsp;
     
      </font></td>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Projekter:
          <input <%If (CStr((Recordset1.Fields.Item("samarbejde4").Value)) = CStr("Y")) Then Response.Write("checked")%> name="samarbejde4" type="checkbox" id="samarbejde4" value="Y">
          <br>
Firmabes&oslash;g:
<input <%If (CStr((Recordset1.Fields.Item("samarbejde5").Value)) = CStr("Y")) Then Response.Write("checked")%> name="samarbejde5" type="checkbox" id="samarbejde5" value="Y">
      </font></td>
      <td colspan="2" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">&nbsp; </font><font size="2" face="Tahoma, Verdana">Andet:
       
      </font><font size="2" face="Tahoma, Verdana">
        <textarea name="samarbejde6" cols="40" id="samarbejde6"><%=(Recordset1.Fields.Item("samarbejde6").Value)%></textarea>
      </font></td>
      </tr>
    <tr>
      <td valign=top bgcolor="#D9D9D9" ><strong><font size="2"><span style='font-family:Verdana'>&Oslash;nsker fra firma </span></font><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>:</span></font></strong></td>
      <td colspan="4" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Ja
          <input <%If (CStr((Recordset1.Fields.Item("ønsker").Value)) = CStr("Y")) Then Response.Write("checked")%> name="ønsker" type="checkbox" id="ønsker" value="Y">
      </font></td>
    </tr>
    <tr>
      <td width="143" valign=top bgcolor="#D9D9D9" ><strong><font size="2"><span style='font-family:Verdana'>Beskrivelse af &oslash;nske</span></font><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>:</span></font></strong></td>
      <td colspan="4" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">
        <textarea name="&oslash;nskerbeskriv" cols="80" rows="4" id="&oslash;nskerbeskriv"><%=(Recordset1.Fields.Item("ønskerbeskriv").Value)%></textarea>
      </font></td>
    </tr>
    <tr>
      <td width="143" rowspan="5" valign=top bgcolor="#D9D9D9" ><strong>EAMV kontaktpersoner :      </strong></td>
      <td width="167" colspan="1" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Administrations&oslash;konom</font>        </td>
      <td width="182" valign=top bgcolor="white" ><input name="eamvkontakt1" type="text" id="eamvkontakt1" value="<%=(Recordset1.Fields.Item("eamvkontakt1").Value)%>" size="30" ></td>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Byggetekniker</font>        </td>
          <td width="296" valign=top bgcolor="white" ><input name="eamvkontakt2" type="text" id="eamvkontakt2" value="<%=(Recordset1.Fields.Item("eamvkontakt2").Value)%>" size="30" ></td>
    </tr>
    <tr>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Datamatiker</font>        </td>
      <td valign=top bgcolor="white" ><input name="eamvkontakt3" type="text" id="eamvkontakt3" value="<%=(Recordset1.Fields.Item("eamvkontakt3").Value)%>" size="30" ></td>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">E-Integrator </font>        </td>
          <td valign=top bgcolor="white" ><input name="eamvkontakt4" type="text" id="eamvkontakt4" value="<%=(Recordset1.Fields.Item("eamvkontakt4").Value)%>" size="30" ></td>
    </tr>
    <tr>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Finans&oslash;konom</font>        </td>
      <td valign=top bgcolor="white" ><input name="eamvkontakt5" type="text" id="eamvkontakt5" value="<%=(Recordset1.Fields.Item("eamvkontakt5").Value)%>" size="30" ></td>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Laborant</font>        </td>
          <td valign=top bgcolor="white" ><input name="eamvkontakt6" type="text" id="eamvkontakt6" value="<%=(Recordset1.Fields.Item("eamvkontakt6").Value)%>" size="30" ></td>
    </tr>         
    <tr>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Markedsf&oslash;rings&oslash;konom Viborg</font>        </td>
      <td valign=top bgcolor="white" ><input name="eamvkontakt7" type="text" id="eamvkontakt7" value="<%=(Recordset1.Fields.Item("eamvkontakt7").Value)%>" size="30" ></td>
      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Markedsf&oslash;rings&oslash;konom Thisted</font></td>
                <td valign=top bgcolor="white" ><input name="eamvkontakt8" type="text" id="eamvkontakt8" value="<%=(Recordset1.Fields.Item("eamvkontakt8").Value)%>" size="30" ></td>
    </tr>
    <tr>
      <td colspan="1" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Procesteknolog</font>        </td>
      <td colspan="1" valign=top bgcolor="white" ><input name="eamvkontakt9" type="text" id="eamvkontakt9" value="<%=(Recordset1.Fields.Item("eamvkontakt9").Value)%>" size="30" > </td>

      <td valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana">Produktionsteknolog</font>        </td>
      <td valign=top bgcolor="white" ><input name="eamvkontakt10" type="text" id="eamvkontakt10" value="<%=(Recordset1.Fields.Item("eamvkontakt10").Value)%>" size="30" ></td>
    </tr>
    <tr>
      <td width="143" valign=top bgcolor="#D9D9D9" ><strong>Tilladelse til kontakt: </strong></td>
      <td colspan="4" valign=top bgcolor="white" ><font size="2" face="Tahoma, Verdana"> Ja:
        <input <%If (CStr(Recordset1.Fields.Item("givetlov").Value) = CStr("1")) Then Response.Write("CHECKED") : Response.Write("")%> name="givetlov" type="radio" value="1">
        Nej:
        <input <%If (CStr(Recordset1.Fields.Item("givetlov").Value) = CStr("0")) Then Response.Write("CHECKED") : Response.Write("")%> name="givetlov" type="radio" value="0">
        Ej opdateret: <input <%If (CStr(Recordset1.Fields.Item("givetlov").Value) = CStr("2")) Then Response.Write("CHECKED") : Response.Write("")%> name="givetlov" type="radio" value="2">   
</font></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan="5" valign=top ><font size="2" face="Tahoma, Verdana">&nbsp;</font><font size="2" face="Tahoma, Verdana">&nbsp;</font></td>
    </tr>

    <tr>
      <td  colspan="5" valign=top ><p><font size="2" face="Tahoma, Verdana"><span style='font-family:Verdana'>Ovenst&aring;ende
          er indforstået med at ovenstående oplysninger bruges i Erhvervsakademi
          MidtVest.<br>
      </span></font><font face="Tahoma, Verdana" size="2">Hvis du senere vil opdatere dine
          oplysninger, logger du bare p&aring; igen med dit user og password,
          indtaster &aelig;ndringerne og godkender.</font></p>
        <p> <font size="2" face="Tahoma, Verdana">
          <input type="submit" style="font:10pt Arial; border:1 solid darkblue;cursor:hand;background:#66CCFF" value="Klik og gem dine ændringer" name="SUBMITKNAP"  ID="SUBMITKNAP" DISABLED>
        </font>          <font face="Tahoma, Verdana"><a href="godkendt.asp?h=2&list_pos=m2" class="A1">Retur  til menu </a></font> </p>
       
      <input type="hidden" name="MM_update" value="form1">
  <input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("id").Value %>">     
         
      </td>
    </tr>
  </table>
  </form>

</td>
  </tr>
</table>
</body>
</html>
<%
Recordset1.Close()
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>
<%
Recordset3.Close()
Set Recordset3 = Nothing
%>
Avatar billede roenving Novice
08. oktober 2005 - 21:21 #3
Hvordan mener du 'tilbage' ?-)

-- hvis brugeren trykker på browserens tilbage-knap kan du stort set ikke gøre noget, men hvis du har en tilbage-knap, kan du jo disable den indtil der er gemt eller checke for om der er gemt, når der trykkes på den !-)

-- der er godt nok en onunload-event, men den kan ikke bruges til andet end at give en meddelelse, for du kan ikke forhindre unload, og så er data jo allerede tabt ...

-- IE har så en ekstra event, der hedder onbeforeunload, hvor man kan noget mere, men så egner det sig jo ikke til indernettet, men kun til intranet, hvor man kan kontrollere brugernes browsere !o]
Avatar billede gummisko Nybegynder
09. oktober 2005 - 10:15 #4
hej
yesyes
Retur  til menu springer fra formularen og til menuen. Min ide var, at hvis der er sket ændringer i menuen, så skulle man lige huske brugeren på at gemme disse, før man klikker på Retur  til menu. Der kunne være brugere som tror at ændringerne er gemt bare ved at indtaste dem i formularen. Hvis de derefter klikker på Retur  til menu er alle ændringer jo væk.
Avatar billede roenving Novice
09. oktober 2005 - 16:40 #5
Hvis du har en 'Retur til menu'-knap, kan du jo submitte der, hvis det ikke allerede er submittet !-)
Avatar billede psykochicken Nybegynder
09. oktober 2005 - 17:35 #6
onbeforeunload virker også fra mozilla 1.7: http://www.mozilla.org/status/2004-03-01.html !-)
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
Vi tilbyder markedets bedste kurser inden for webudvikling

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