george Posted June 10, 2008 Share Posted June 10, 2008 To help me debug a form, I created this simple little script function showme() { x = document.getElementById("edPropForm"); for (var i=1; i<x.length; i++) { document.write(x.elements[i].id); }} Which after the first field id is given, stops in it's tracks with a permission denied message. The error message is the standard IE Windows alert type message box. Any ideas? Link to comment Share on other sites More sharing options...
jeffman Posted June 10, 2008 Share Posted June 10, 2008 Idea 1. You start with i=1 instead of i=0.Idea 2. If a form element has no value, or an undefined value, your loop will probably break, yeah.EDIT:Idea 3. You're using document.write() but the document is already written and closed, so the method overwrites the original document in the first loop iteration. Try alert() instead of document.write() Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.