Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Location
    New Mexico
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question script not finding the correct form

    I am using the javascript below to page forward and backward month to month in a coldfusion calendar app and it works fine EXCEPT when there is an include that contains two other forms (both named)

    Then I get an error message ('options' is null or not an object)presumably because gotoMonth() is not looking at the correct form. This is not my script and I was wondering if there is someone around with enough javascript knowhow to help? thanks ~meg
    ===================
    script:

    <script>
    function gotoMonth()
    {
    var theMonthList = document.forms[0].cboMonth;
    var theYearList = document.forms[0].cboYear;
    var theMonth = theMonthList.options[theMonthList.selectedIndex].value;
    var theYear = theYearList.options[theYearList.selectedIndex].value;
    theLocation = "index.cfm?fuseaction=ViewGoToMonth&GoToYear=" + theYear + "&GoToMonth=" + theMonth;
    window.open(theLocation, "_top", "")
    }
    </script>

    calling the script:

    <input type="button" value=" Go " onclick="JavaScript:gotoMonth()" onmouseover="self.status='Go';return true" onmouseout="self.status='';return true">

    if I need to post the whole for let me know and I will do so, but it will contain coldfsuion code that dynamically fills the options thanks again, meg

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Change what is highlighted in red to reflect the name of your form.

    var theMonthList = document.forms[0].cboMonth;
    var theYearList = document..forms[0].cboYear;

    .....Willy

  • #3
    New to the CF scene
    Join Date
    Dec 2003
    Location
    New Mexico
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks! I appreciate your help - meg


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •