Hallo,
ich baue mir ein Formular dynamisch auf, und weiß vorher noch nicht, ob ein Element (z.B. document.form.textbox.value) da ist
Ich belege aber eine Variable mit dem Wert dieser Textbox. Falls sie nicht da ist, will ich einen leeren String in die Variable schreibenHat jemand eine Idee ?
Du suchst 'typeof'
if(typeof document.form == 'undefined') return alert('form existiert nicht.');
if(typeof document.form.textbox == 'undefined') return alert('textbox existiert nicht.');
Struppi.