and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a weird problem. I have this javascript function. Area0 Area1 etc are drop down boxes.
[syntax="html"]<script language = javascript >
var areanum = -1
function addArea(){
areanum = areanum + 1
if(areanum == 0) {document.form2.Area0.disabled= false}
if(areanum == 1) {document.form2.Area1.disabled= false}
if(areanum == 2) {document.form2.Area2.disabled= false}
if(areanum == 3) {document.form2.Area3.disabled= false}
if(areanum == 4) {document.form2.Area4.disabled= false}
if(areanum == 5) {document.form2.Area5.disabled= false}
}
</script>
I have a button <a href = "javascript:addArea()"><input type="button" value="Add Area" name="B3"></a> calling the function
What this is supposed to do is, that every time i press the button one more drop down list is enabled.
For some reason every time i press the button 2 drop down boxes are enabled....WHY??
Moreover does anyone have an idea how to make the disables boxes invisible and visible instead of enabled-disabled?
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
One is standards compliant, the other isn't if memory serves. It works in several browsers because of the lax nature in which they have implemented Javascript.
ok!!thanks for letting me know...can you check this topic as well plz in case you know the answer.if you cant bother its ok.
Thanks anyway for the really helpfull tips