You can reuse the function and you're pretty close to it.
The document.forms[...] method is the way to go.
What you put between the square brackets is a string or string variable that is the same as the form name.
I'm guessing you got the idea right, but in the example you posted your...
That's because IE7 doesn't set the selected value 'till after the page has loaded and your script executes before that, which means it will detect the default value, 1.
A solution would be to have the code execute onload, since IE will have set the field value by then, but you can't use that...
Ye, Billy's code is fine just as well, more compact even.
Although, if I must point something out, it's that Billy's code does not let you deselect your last/single selected option (meaning that once you selected something, you cannot have no selection anymore).
Of course, that may not be an...
Well, it's an interesting idea, so I had a go at it...
I'm disappointed that I couldn't find any way to capture and prevent the selecting of an option.
IE7 wouldn't even let me detect an option click at all it seemed.
I got something working, but I'm not entirely satisfied since you can clearly...
I don't know if it's good enough for you dwight, but you can have multiple selections in a multiple select box while by holding the ctrl-key while clicking new options.
I was doing some hopeless messing around to analyse the problem when I noticed that suddenly Firefox was actually not rendering the changes during the functions anymore, hooray!
Stripping out all the test code that didn't induce this behaviour, the magic seemed to be done by adding this line of...
Hello,
I'm making some sort of sliding menu for a site.
The effect involves having 2 slide effects at the same time. One to close a menu section and one to open a menu section, giving the impression the opening one slides over the closing one.
I have an interval repeating a function that...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.