SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Threaded View

  1. #1
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Having problems with my function

    Basically what I'm doing is making a pop up calendar that'll be used to select a day.

    The calendar has text links, when clicked it runs my function.

    That function is suppose to parse the date and send it back to the parent window, put the focus on it, then close the window.

    However I'm getting this error when the function is called:
    Line: 30
    Char: 2
    Error: 'opener.document.req_info.select2' is not an object'
    Code: 0
    URL: http://localhost/pop_cal.jsp
    Here's the function
    Code:
    function select_date(clicked_date)
    {
    	var clicked_month;
    	var clicked_day;
    	var clicked_year;
    
    	clicked_month = clicked_date.substring(0,2);
    	clicked_day = clicked_date.substring(3,5);
    	clicked_year = clicked_date.substring(6,10);
    	// alert(clicked_month + '/' + clicked_day + '/' + clicked_year);
    
    	opener.document.req_info.select1.selectedIndex.value = clicked_month;
    	opener.document.req_info.select2.selectedIndex.value = clicked_day;
    	opener.document.req_info.select3.selectedIndex.value = clicked_year;
    	opener.focus();
    	window.close();
    }
    And this is how i'm calling it:
    Code:
    <TD VALIGN=MIDDLE class="tinytext2" nowrap id="reverse1" align="center" valign="middle" onMouseOver="this.style.backgroundColor='#6688AA'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#384D6C';" onClick="select_date(07-01-2003)">
    That date is dynamically generated.
    Last edited by Defender1; Aug 5, 2003 at 13:56.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


Bookmarks

Posting Permissions

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