ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
820
820
EMPFEHLEN
-
Guten Morgen,
ich habe da zwei (für euch wohl kleine) Probleme.
Zum einen, ich möchte das sich mein Formular sich nach Auswahl eines Pulldown Feldes aktualisiert, was aber nicht funktioniert.
Fehlermeldung:
Das Objekt unterstützt diese Eigenschaft oder Methode nicht
Warum?
Hier die Codezeile:
Code :1
<select class="form_field" name="select_DepartmentID" id="select_DepartmentID" onChange="document.LoginForm.submit()">
Zweitens: wenn ich das Form manuell neu lade und z.B. die DepartmentID mitgebe, zeigt er mir an, dass diese z.B. 80 ist.
Wenn ich aber nun das Formular neu aufbauen lasse und sage, das dort wo die DepartmentID 80 ist, das Objekt selektiert sein soll, macht das Script das nicht.
Codezeile:
Code :1 2 3 4 5 6 7 8 9 10 11 12
Set rs3 = Server.CreateObject("ADODB.Recordset") sql3 = "SELECT * FROM AbtListe" rs3.Open sql3, cn, 0, 1, 1 Do While Not rs3.EOF if wert_department = rs3.Fields(0).value then Response.Write("<option select ") else Response.Write("<option ") end if Response.Write("value='" & rs3.Fields(0).value & "'>" & rs3.Fields(2).value & "</option>") rs3.MoveNext LOOP
hier mal das ganze Script:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
<%@ LANGUAGE="VBScript" %> <html> <head> <title>Test TimeKeeping</title> <link href="layout/design.css" rel="stylesheet" type="text/css"> </head> <body> <% openStr = "Data Source=../../Inetpub/wwwroot/FTP-Test/TimeKeepingXP.mdb; Provider=Microsoft.Jet.OLEDB.4.0" Set cn = Server.CreateObject("ADODB.Connection") cn.Open openStr Set rs1 = Server.CreateObject("ADODB.Recordset") wert_location=request.Form("select_LocationID") if wert_location <> "" then sql1="SELECT * FROM Personen WHERE LocationID = " & select_LocationID end if wert_department = request.Form("select_DepartmentID") if wert_department <> "" then sql1="SELECT * FROM Personen WHERE DepartmentID = " & select_DepartmentID end if if (wert_department = "") or (wert_location = "") then sql1 = "SELECT * FROM Personen" end if rs1.Open sql1, cn, 0, 1, 1 %> <br> <table align="center" border="0" cellspacing="0" cellpadding="0" background="graphics/window_05.jpg"> <tr> <td width="21" height="29" colspan="2" background="graphics/window_01.jpg"></td> <td background="graphics/window_02.jpg"> <span class="cattitle">Choose the Name:</span></td> <td width="28" height="29" colspan="3" background="graphics/window_03.jpg"></td> </tr> <tr> <td width="3" background="graphics/window_04.jpg"></td> <td width="18"></td> <td> <form action="auswahl.asp" method="post" name="LoginForm"> <table> <tr> <td><div class="maintitle">Name:</div></td> <td><select class="form_field" name="last_name"> <% Do While Not rs1.EOF Response.Write("<option value='" & rs1.Fields(0) & "'>" & rs1.Fields(1).value & " " & rs1.Fields(2).value & "</option>") rs1.MoveNext LOOP %> </select></td> </tr> <tr> <td colspan="2" height="10"></td> </tr> <tr> <td><div class="gen">Location:</div></td> <td><select name="LocationID" class="form_field" id="select_LocationID"> <% Set rs2 = Server.CreateObject("ADODB.Recordset") sql2 = "SELECT * FROM DelphiLocations" rs2.Open sql2, cn, 0, 1, 1 Do While Not rs2.EOF Response.Write("<option value='" & rs2.Fields(0).value & "'>" & rs2.Fields(1).value & "</option>") rs2.MoveNext LOOP %> </select></td> </tr> <tr> <td><div class="gen">Department:</div></td> <td><select class="form_field" name="select_DepartmentID" id="select_DepartmentID" onChange="document.LoginForm.submit()"> <% Set rs3 = Server.CreateObject("ADODB.Recordset") sql3 = "SELECT * FROM AbtListe" rs3.Open sql3, cn, 0, 1, 1 Do While Not rs3.EOF if wert_department = rs3.Fields(0).value then Response.Write("<option select ") else Response.Write("<option ") end if Response.Write("value='" & rs3.Fields(0).value & "'>" & rs3.Fields(2).value & "</option>") rs3.MoveNext LOOP %> </select></td> </tr> <tr> <td colspan="2" height="10"> <% Response.Write(wert_department) %> </td> </tr> <tr> <td></td> <td><input type="submit" class="form_submit" name="submit" value="OK"></td> </tr> </table> </form> </td> <td width="25"></td> <td width="3" background="graphics/window_06.jpg"></td> </tr> <tr> <td height="3" colspan="5" background="graphics/window_07.jpg"></td> </tr> </table> <% rs1.Close rs2.Close rs3.Close cn.Close %> </body> </html>
Bin noch absoluter Anfänger mit ASP und wäre für einen Gedankenanstoss sehr dankbar.
Gruß, Oliver
Ähnliche Themen
-
Record Set Eintrag mit String vergleichen
Von Bamboocha_10 im Forum Visual Basic 6.0Antworten: 3Letzter Beitrag: 21.01.08, 15:39 -
Eintrag mit anderen vergleichen (mysql)
Von Acriss im Forum Relationale DatenbanksystemeAntworten: 0Letzter Beitrag: 01.10.07, 18:55 -
[Formular] Eingabe vergleichen (MySQL)
Von Maddin007 im Forum PHPAntworten: 4Letzter Beitrag: 05.06.07, 14:11 -
Formular/Überprüfung/DB-Eintrag in einer Funktion: Eintrag kommt doppelt!
Von 27apricot im Forum PHPAntworten: 0Letzter Beitrag: 27.10.06, 15:25 -
DB eintrag ändern per formular
Von boardcash im Forum PHPAntworten: 1Letzter Beitrag: 17.07.05, 00:46





Zitieren
Login





