[Javascript] Javascript - Form value undefined

Walter Torres walter at torres.ws
Tue Nov 11 01:15:46 CST 2003


Your trying to access a value of an array, without defining the element to
look at.

radio buttons, really any Form Objects with the same NAME will be placed
into an array by the same name.

I changed your submit button...

    <INPUT type="button"
           id="submit"
           value="submit"
           onclick="alert(this.form.inputSugar[1].value);return false;" />

Notice the square bracket [1] ??

This gave me 0.25, as it should.

Hope this helps..

Walter





More information about the Javascript mailing list