Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 22nd, 2005, 08:06 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default null or not a object

I have this javascript code:
Code:
function shodt(flpth,pth,pth1,infld,crdate,seldate,fld) //to display the date window
{
if(fld=="retdt")
    {
        if(document.fexp.depdt.value!="")
        {
            document.fexp.retdt.value="";
            document.fexp.retdt1.value="";
            glbdate="true";
            checkdate(flpth,pth,pth1,infld,crdate,seldate,fld)
        }
    }
    else if(fld=="depdt")
    {
        if(document.fexp.depdt.value=="")
        {
            document.fexp.seldate.value="";
            document.fexp.depdt1.value="";
            seldate="";
        }
        glbdate="true";
        checkdate(flpth,pth,pth1,infld,crdate,seldate,fld)
    }
}


with this image i am sending these parameters to the function:
Code:
<img src="asp/images/hd_icon_calender.gif" align="middle" alt="Calendar" width="21" height="15" border="0" onClick="shodt('calendar.html','document.fexp.depDay.value','document.fexp.depMonth.value','document.fexp.crdate.value','document.fexp.seldate.value','depDay','depDay')">
i get the errror:

document.fexp.retdt.value is null or not a object.

confused


www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
  #2 (permalink)  
Old March 22nd, 2005, 10:21 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Is there an object with an id of retdt in your page? E.g. something like:

<someTag id="retdt" someAttributes="someValue" />

If so, what kind of object / tag is it?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old March 22nd, 2005, 10:29 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

no, there is no mention of retdt on the page

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
  #4 (permalink)  
Old March 22nd, 2005, 10:30 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

basically i am looking for a pop-up calendar that changes drop down menu values

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
  #5 (permalink)  
Old March 22nd, 2005, 10:31 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

any pointers, greatly appreicated

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
  #6 (permalink)  
Old March 22nd, 2005, 10:48 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

To reference something like document.fexp.retdt.value you need a <form> with an name of fexp and a control (like a textbox, dropdown etc) with a name of retdt.

If you don't have this form and control, document.fexp.retdt.value results in a null pointer exception.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Similar Threads
Thread Thread Starter Forum Replies Last Post
'style' is null or not an object earhear Beginning PHP 0 December 4th, 2007 04:22 AM
null or not an object crmpicco Classic ASP Basics 0 July 4th, 2005 05:58 AM
is null or not an object fosterjim Javascript How-To 1 January 24th, 2005 02:11 PM
document null or not an object Adam H-W Javascript 2 April 22nd, 2004 05:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.