 |
| 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
|
|
|
|

March 22nd, 2005, 08:06 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 22nd, 2005, 10:21 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

March 22nd, 2005, 10:29 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|

March 22nd, 2005, 10:30 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|

March 22nd, 2005, 10:31 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|

March 22nd, 2005, 10:48 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|
 |