Log in

View Full Version : Help: popup calendar problem: Target form field is not assigned or not accessible !



kumail
08-21-2005, 12:38 PM
hello

I am new to Javascripts (actually I am new to scripts in general not only to javascripts :) ).

I have downloaded a popup calendar from:
http://www.dynamicdrive.com/dynamicindex6/popcalendar.htm

I followed the instructions step by step but I am getting the following error msg:

"Target form field is not assigned or not accessible !"

I have saved the popdate.js and the mycal.asp files in the same wwwroot directory.

in mycal.asp I have added the following:




<form name="sample">
<input type="button" value="Start Date" <a href="javascript://" onClick="getCalendarFor(document.sample.choise2);return false">[Choose one]</a>
</form>



when I open mycal.asp in the browser, I get the error msg I mentioned above.

Can anybody help me to solve this problem please ?

thank you in advanve
Kumail

jscheuer1
08-21-2005, 03:20 PM
What's "choise2"? According to the instructions for this script, you need a named form element to receive the data, ex (using your code):

<form name="sample">
<input type="text" name="choise2">
<input type="button" value="Start Date" onClick="getCalendarFor(document.sample.choise2)">
</form>By way of explanation, if you are using a button to activate the script, you do not need an anchor link tag and there is no default return for a button, so no 'return false;' is required.