WebWork Magazin - Webseiten erstellen lassen, Online Medien, html

Webhoster, Webhosting Provider und Domain registrieren

Home | Registrieren | Einloggen | Suchen | Aktuelles | GSL-Webservice | Suleitec Webhosting
Reparatur-Forum | Elektro forum | Ersatzteilshop Haushalt und Elektronik


Homepage und Webhosting-Forum

HTML, XHTML, CSS , style, XML, Javascript und mehr, Fragen, Tipps und Anregungen zu diesen Basic Techniken - hier rein !


Forum » HTML, CSS - Hilfe für das Erstellen einer Homepage » JavaScript Fehler "ist Null oder kein Objekt" » Antworten
Benutzername:
Passwort: Passwort vergessen?
Inhalt der Nachricht: Fett | Kursiv | Unterstrichen | Link | Bild | Smiley | Zitat | Zentriert | Quellcode| Kleiner Text
Optionen: Emailbenachrichtigung bei Antworten
 

Die letzten 5 Postings in diesem Thema » Alle anzeigen
von n0f3aR
Hat sich erledigt, hab den Fehler gefunden und behoben. Beim ersten mal funktioniert, wenn man dann auf weiter geht, dann ändert sich das Feld und heißt nicht mehr cbobranche, sondern txtbranche, daher der Fehler erst am Ende. Trotzdem danke
von languitar
ähm, Sorry, aber den Code wird wohl kaum jemand ganz lesen wollen. Versuch das doch mal aufs wesentliche zu reduzieren.

Anhand der Fehlermeldung würde ich sagen, dass er branche nicht finden kann. Vielleicht gibt es kein Feld, das so heißt.
von n0f3aR
Hallo!

Ich hab ein Formular zum registrieren und eintragen in eine Datenbank, und das funktioniert auch alles, nur es wird mir trotzdem ein Fehler ausgegeben:

Zeile:85
Zeichen:3
Fehler: 'branche.value* ist Null oder kein Objekt
Code:0
URL....registrieren.asp


Hier ist der Code dafür, es dürfte der JS teil und das Formular interessant sein
Den ASP Teil hab ich jetzt größtenteils weggelassen!

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: 
119: 
120: 
121: 
122: 
123: 
124: 
125: 
126: 
127: 
128: 
129: 
130: 
131: 
132: 
133: 
134: 
135: 
136: 
137: 
138: 
139: 
140: 
141: 
142: 
143: 
144: 
145: 
146: 
147: 
148: 
149: 
150: 
151: 
152: 
153: 
154: 
155: 
156: 
157: 
158: 
159: 
160: 
161: 
162: 
163: 
164: 
165: 
166: 
167: 
168: 
169: 
170: 
171: 
172: 
173: 
174: 
175: 
176: 
177: 
178: 
179: 
180: 
181: 
182: 
183: 
184: 
185: 
186: 
187: 
188: 
189: 
190: 
191: 
192: 
193: 
194: 
195: 
196: 
197: 
198: 
199: 
200: 
201: 
202: 
203: 
204: 
205: 
206: 
207: 
208: 
209: 
210: 
211: 
212: 
213: 
214: 
215: 
216: 
217: 
218: 
219: 
220: 
221: 
222: 
223: 
224: 
225: 
226: 
227: 
228: 
229: 
230: 
231: 
232: 
233: 
234: 
235: 
236: 
237: 
238: 
239: 
240: 
241: 
242: 
243: 
244: 
245: 
246: 
247: 
248: 
249: 
250: 
251: 
252: 
253: 
254: 
255: 
256: 
257: 
258: 
259: 
260: 
261: 
262: 
263: 
264: 
265: 
266: 
267: 
268: 
269: 
270: 
271: 
272: 
273: 
274: 
275: 
276: 
277: 
278: 
279: 
280: 
281: 
282: 
283: 
284: 
285: 
286: 
287: 
288: 
289: 
290: 
291: 
292: 
293: 
294: 
295: 
296: 
297: 
298: 
299: 
300: 
301: 
302: 
303: 
304: 
305: 
306: 
307: 
308: 
309: 
310: 
311: 
312: 
313: 
314: 
315: 
316: 
317: 
318: 
319: 
320: 
321: 
322: 
323: 
324: 
325: 
326: 
327: 
328: 
329: 
330: 
331: 
332: 
333: 
334: 
335: 
336: 
337: 
338: 
339: 
340: 
341: 
342: 
343: 
344: 
345: 
346: 
347: 
348: 
349: 
350: 
351: 
352: 
353: 
354: 
355: 
356: 
357: 
358: 
359: 
360: 
361: 
362: 
363: 
364: 
365: 
366: 
367: 
368: 
369: 
370: 
371: 
372: 
373: 
374: 
375: 
376: 
377: 
378: 
379: 
380: 
381: 
382: 
383: 
384: 
385: 
386: 
387: 
388: 
389: 
390:
<head>
<title>registrieren</title>
<link rel=stylesheet type="text/css" href="mcd.css">
<script language = "JavaScript" type="text/javascript">
<!--
var email;
var firma;
var name;
var strasse;
var plz;
var ort;
var vorwahl;
var tel;
var fax;


 function InitVar(){

         email = document.Formular.txtemail;
         firma = document.Formular.txtfirma;
         name = document.Formular.txtname;
         strasse = document.Formular.txtstrasse;
         plz = document.Formular.txtplz;
         ort = document.Formular.txtort;
         vorwahl = document.Formular.txtvorwahl;
         tel = document.Formular.txttelefon;
         fax = document.Formular.txtfax;
         branche = document.Formular.cbobranche;
  }

<%
  For i=0 To 14
%>
          Msg<%=i%> = "<%=Msg(i)%>";
<%
  Next
%>

function chkFrmR(){

  InitVar();

  if(firma.value == "")
  {
    alert(Msg0);
    firma.focus();
    return false;
  }
  if(name.value == "")
  {
    alert(Msg1);
    name.focus();
    return false;
  }
  if (branche.value == 0)
  {
    Msg<%=16%> = "<%=Msg(16)%>";
    alert (Msg16);
    email.focus();
    return false;
  }
  if(strasse.value=="")
  {
    alert(Msg2);
    strasse.focus();
    return false;
  }
  if(plz.value == "")
  {
    alert(Msg3);
    plz.focus();
    return false;
  }
   if(ort.value== "")
  {
    alert(Msg4);
    ort.focus();
    return false;
  }
  if (vorwahl.value=="")
  {
    alert(Msg5);
    vorwahl.focus();
    return false;
  }
 var chkZ = 1;
 for(i=0;i<vorwahl.value.length;++i)
   if(vorwahl.value.charAt(i) < "0"
   || vorwahl.value.charAt(i) > "9")
     chkZ = -1;
 if(chkZ == -1) {
   alert(Msg5);
   vorwahl.focus();
   return false;
  }
  if (tel.value=="")
  {
    alert(Msg6);
    tel.focus();
    return false;
  }
 var chkZ = 1;
 for(i=0;i<tel.value.length;++i)
   if(tel.value.charAt(i) < "0"
   || tel.value.charAt(i) > "9")
     chkZ = -1;
 if(chkZ == -1) {
   alert(Msg6);
   tel.focus();
   return false;
  }


  if (fax.value=="")
  {
    alert(Msg6);
    fax.focus();
    return false;
  }
 var chkZ = 1;
 for(i=0;i<fax.value.length;++i)
   if(fax.value.charAt(i) < "0"
   || fax.value.charAt(i) > "9")
     chkZ = -1;
 if(chkZ == -1) {
   alert(Msg6);
   fax.focus();
   return false;
  }


  if (email.value=="")
  {
    alert(Msg7);
    email.focus();
    return false;
  }
  if (email.value.length < 6)
  {
    alert(Msg8);
    email.focus();
    return false;
  }
  if (email.value.indexOf("@") == -1)
  {
    alert(Msg9);
    email.focus();
    return false;
  }
  if (email.value.indexOf(".") == -1)
  {
    alert (Msg10);
    email.focus();
    return false;
  }
}
//-->
</script>
</head>
<body class="bg">
<table width="100%" border="0">
  <tr>
    <th width="93%">
      &nbsp;
    </th>
    <th class="graycolor" width="7%">
      <a class="Lnk1" href="javascript:history.back(-1)" Target = '_self'>
      <%=uebersetzen("zurück")%></a>
    </th>
  </tr>
</table><br>
<%If (VAbg = "3") Then
        If setKunde() Then %>
                <script language = "JavaScript" type="text/javascript">
                <!--
                        alert(Msg14);
                        self.location.href="home.asp"
                 //-->
                 </script>
        <%End If%>
<%Else%>
<form name="Formular" action="registrieren.asp" method="post" onSubmit="return chkFrmR()">
<input type="hidden" name="abgeschickt" value="<%=VAbg%>">
<%If (ChkMail="OK") Then %>
        <p id ="Msg1"> <%=Msg(15)%> </p>
<%End If%>
<table width="100%" border="0">
  <tr>
    <td width="15%" class="rechts">
      <b><%=uebersetzen("registrieren")%></b>
    </td>
    <td colspan="3" width="85%">
      &nbsp;
    </td>
  </tr>
  <tr>
    <td colspan="4" width="100%">
      &nbsp;
    </td>
  </tr>
  <tr>
    <td width="15%" class="rechts">
      *<%=uebersetzen("Firma")%>:
    </td>
    <td width="37%"><input type="text" name="txtfirma" size="50" maxlength="50" value="<%=VFirma%>" <%=VExt%>></td>
    <td width="10%" class="rechts">
      &nbsp;
    </td>
    <td width="38%">
      <%If ((ChkMail="OK") OR (ChkMail="Err")) Then %>
        <input type="text" name="txtanrede" size="10" value="<%=VAnrede%>" <%=VExt%>>
      <%Else%>
        <select name="cboanrede" size="1">
        <Option Value="1" Selected><%=uebersetzen("Herr")%>
        <Option Value="2"><%=uebersetzen("Frau")%></Select>
      <%End If%>
    </td>
  </tr>
  <tr>
    <td width="15%" class="rechts">
      *<%=uebersetzen("Name")%>:
    </td>
    <td width="37%">
      <input type="text" name="txtname" size="50" maxlength="50" value="<%=VName%>"<%=VExt%>>
    </td>
    <td width="10%" class="rechts">
      <%=uebersetzen("Vorname")%>:
    </td>
    <td width="38%">
      <input type="text" name="txtvorname" size="30" maxlength="30" value="<%=VVorname%>"<%=VExt%>>
    </td>
  </tr>
  <tr>
    <td width="15%" class="rechts">
      <%=uebersetzen("Betriebsposition")%>:
    </td>
    <td width="37%">
      <input type="text" name="txtposition" size="50" maxlength="50" value="<%=VPos%>"<%=VExt%>>
    </td>
    <td width="10%" class="rechts">
      *<%=uebersetzen("Branche")%>:
    </td>
    <td width="38%">
      <%If ((ChkMail="OK") OR (ChkMail="Err")) Then %>
        <input type="text" name="txtbranche" size="10" value="<%=VBranche%>"<%=VExt%>>
      <%Else%>
        <select name="cbobranche" size="1">
          <Option Value="0" Selected></option>
          <Option Value="1"><%=uebersetzen("Drucker")%></option>
          <Option Value="2"><%=uebersetzen("Händler")%></option>
          <Option Value="7"><%=uebersetzen("Sonstige")%></option>
        </Select>
      <%End If%>
    </td>
  </tr>
  <tr>
    <td width="15%" class="rechts">
      *<%=uebersetzen("Straße")%>:
    </td>
    <td width="37%">
      <input type="text" name="txtstrasse" size="50" maxlength="50" value="<%=VStr%>"<%=VExt%>>
    </td>
    <td width="10%" class="rechts">
      *<%=uebersetzen("Land")%>:
    </td>
    <td width="38%">
      <%If ((ChkMail="OK") OR (ChkMail="Err")) Then %>
        <input type="text" name="txtland" size="5" value="<%=VLand%>" <%=VExt%> >
      <%Else%>
        <select name="cboland" size="1">
      <%
        Dim Sel
        Dim NextLand
        Dim DBConnLand
        Dim RSLand
        Dim CntLand
        Dim SprLand
        'Sel = "Selected"
        For i = 1 To getCntLand()
        NextLand = getNextLand()
      %>
        <Option Value="<%=i%>" <%=Sel%>>                           <%=NextLand%>
      <%
        'Sel = ""
        Next
        RSLand.Close
        Set RSLand = Nothing
        If DBConnLand.State=1 Then DBConnLand.Close
        Set DBConnLand = Nothing
      %>
        </option>
        </Select>
      <%End If%>
    </td>
  </tr>
  <tr>
    <td width="15%" class="rechts">
      *<%=uebersetzen("PLZ")%>:
    </td>
    <td width="37%">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="35%">
            <input type="text" name="txtplz" size="15" maxlength="15" value="<%=VPlz%>"<%=VExt%>>
          </td>
          <td class="rechts" width="30%">
            *<%=uebersetzen("Ort")%>:
          </td>
          <td class="rechts" width="35%">
            <input type="text" name="txtort" size="15" maxlength="40" value="<%=VOrt%>"<%=VExt%>>
          </td>
        </tr>
      </table>
    </td>
    <td colspan="2" width="48%">
      &nbsp;
    </td>
  </tr>

  <tr>
    <td width="15%" class="rechts">
      *<%=uebersetzen("Ortsvorwahl")%>:
    </td>
    <td width="37%">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="35%">
            <input type="text" name="txtvorwahl" size="15" maxlength="15" value="<%=VOvw%>"<%=VExt%>>
          </td>
          <td class="rechts" width="30%">
            *<%=uebersetzen("Telefon")%>:
          </td>
          <td class="rechts" width="35%">
            <input type="text" name="txttelefon" size="15" maxlength="15" value="<%=VTel%>"<%=VExt%>>
          </td>
        </tr>
      </table>
    </td>
    <td width="10%" class="rechts">
      *<%=uebersetzen("Fax")%>:
    </td>
    <td width="38%">
      <input type="text" name="txtfax" size="15" maxlength="15" value="<%=VFax%>"<%=VExt%>>
    </td>
  </tr>

  <tr>
    <td width="15%" class="rechts">
      *<%=uebersetzen("E-Mail")%>:
    </td>
    <td width="37%">
      <input type="text" name="txtemail" size="50" maxlength="50" value="<%=VEmail%>"<%=VExtM%>>
    </td>
    <td colspan="2" width="48%">
      &nbsp;
    </td>
  </tr>
  <tr>
    <td width="15%" class="rechts">
      <%=uebersetzen("Homepage")%>:
    </td>
    <td width="37%">
      <input type="text" name="txthomepage" size="50" maxlength="50" value="<%=VHomePg%>"<%=VExt%>>
    </td>
    <td colspan="2" width="48%">
      &nbsp;
    </td>
  </tr>
  <tr>
    <td colspan="4" width="100%">
      &nbsp;
    </td>
  </tr>
  <tr>
    <td width="15%">
      &nbsp;
    </td>
    <td width="37%" class="center">
      <input <%=VExt2%>>&nbsp;&nbsp;&nbsp;
      <input type="submit" value="<%=VExt3%>">
    </td>
    <td width="10%">
      &nbsp;
    </td>
    <td width="38%">
      &nbsp;
    </td>
  </tr>
</table>
</form>


Nach oben