javascript simple problem??
Posted: Fri Dec 15, 2006 1:11 pm
feyd | Please use
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?
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
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>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?
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
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]