| re: Please help me!
"Mike Brown" <mikeb455@cox.net> schreef in bericht
news:EqFYa.31040$ff.7131@fed1read01...[color=blue]
> Please look at this section of my code. I am tryong to call the[/color]
checkMonth[color=blue]
> function if the year selected is the current year. I tested the value[/color]
being[color=blue]
> passed to the checkYear function and that is working. I seem to hava a
> problem with the syntax when I call the checkMonth() from the[/color]
checkYear[color=blue]
> function? The rest of the site is coming along nicely. I am new but I[/color]
am[color=blue]
> working hard to learn. Please help. Any advice would be appreciated.
> Thanks, Mike
>
>
>
>
> <html>
>
>
>
> <script language = "javascript">
>
> function checkMonth()
> {
> var today = new Date();
> var thisMonth = today.getMonth();
> var myValue = this.selectMonth.selectedIndex;
>
>
> if (myValue <= thisMonth)
> {
> alert("Month has expired")
> }
>
> }
>[/color]
<snip code>
Hi,
"this" does not have the scope that you obviously expect from it here.
Try:
var myValue = document.forms["myform"].selectMonth.selectedIndex;
Fred |