#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    2
    Rep Power
    0

    Javascript popup problem


    I have a lengthy form for some of our customers to use to place orders. A small, working piece of it is here:

    http://www.paramountcoffee.net/jstest

    The idea was to have a window pop up on form submit to allow the user to see what he had ordered, and to go back to correct the order if necessary. The script I came up with works fine, but stops collecting name/value pairs at the first </div> tag. I suspect the problem is in the line -

    for(var x = _f.firstChild; x ; x=x.nextSibling)

    but I don't know how to fix it if it is. If someone could point me in the right direction, I'd appreciate it.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2003
    Posts
    1,014
    Rep Power
    15
    First: please clean up your code. Use the W3C validator to guide you. There were two <body tags, just to mention one error.
    If the cleanup code does not solve your popup problem, try this:

    Code:
    	for (i = 0; i< _f.elements.length; i++) {
    		x = _f.elements[i]
    		if(x.type=="text" || x.type=="textarea") {
    			if(x.value!="")
    				s+=x.name+t+x.value+n;
    		}
    	}
    	return confirm(b+n+n+s+n+l);
    Hope this helps,
    Jeroen
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    2
    Rep Power
    0
    Great! It helps a great deal, Jerom. Thanks much. Thanks also for the html code advice.

    Steve

IMN logo majestic logo threadwatch logo seochat tools logo