Link to home
Start Free TrialLog in
Avatar of jkwasson
jkwasson

asked on

Javascript document.request - what does this do?

I am working on making some changes to an app that I did not write. I have encountered some code that I am unsure what it does...

When the link below is clicked, a little calendar page is loaded as a popup so user can selected a date. Here is the code in question:

<img src="../shared/pics/calendar.gif" border=0 width=16 height=16 alt="Calendar Selection Wizard" onClick="window.dateField=document.request.start_date;window.open('../shared/asp/cal.asp','start_date_calendar','width=255,height=255');" style="cursor: hand">

what I am particularly interested in is what is that code in the onClick event doing?

When I click on the link in my app I get an error stating that document.request.start_date is either null or not an object.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Batalf
Batalf
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jkwasson
jkwasson

ASKER

lol, I think I figured it out. I am a JavaScript noob....

request is the name of a form on this page.  I was thinking request was the request object, which I wasn't finding much info on...

I am going to give you the points Batalf because your idea to search the html page for request.start_date is what led me to find out that was the name of a form!

Thanks!
Thanks!

Glad it worked out for you!

Batalf