| Mick White 2005-10-31, 10:22 pm |
| RobGT wrote:
> Hi Mick,
> Not sure I follow what you said there?
>
> In my answer post I missed the fact that my variables to collect form
> element info are pre-set earlier in my script code, like this:
>
> var frmCountry = document.getElementById('country');
>
> Is my code still ok, or should I change it over?
This is OK, but the forms collection works on more browsers.
var frmCountry = document.forms["formName"].elements["country"];
>
> for (optionCounter = 0; optionCounter < frmCountry.length; optionCounter++)
> {
//If this loop is within a function, I would use:
var o=frmCountry.length
while(o--){with(frmCountry.options[o]){
selected=(value==hidCountry.value);
}
}
Mick
--
Isn't it enough to see that a garden is beautiful without having
to believe that there are fairies at the bottom of it too?
[Douglas Adams]
|