Re: Javascript Bug?



RobG wrote:

> Marshall Dudley wrote:
> > I followed those instructions, and now if there is only one button, it
> > works as it should, but if there is more than one button, that stopped
> > working. This is what I did:
> >
> > var radioCollection
> > radioCollection =
> > document.CC.elements["Ecom_Payment_Card_Type"];
> > if(typeof radioCollection != "number" ){
>
> You missed a bit-------------------^^
>
> if(typeof radioCollection.length != "number"){
>
> If you are using the code from the FAQ, then look at the length property
> as a way of telling if you have an HTML collection or an element.
>

Bingo! Thanks, I had changed so many things trying to get it to work, I
somehow managed to lose the .length from that conditional. Put it in and
now it is working as desired. (Unfortunately I am a perl programmer that has
little understanding of javascript).

Many Thanks,

Marshall

.


Quantcast