Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: No target control specified
bethany
Junior Member

Posts: 2
Registered: 3/6/2003
Member Is Offline
posted on 3/6/2003 at 12:06 PM Reply With Quote
No target control specified


Hi, I am getting the error "...No target control specified" when using the calender. If I comment the lines out that include the error messages, the calendar works fine. Does this affect how the calender works? I
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 3/6/2003 at 02:06 PM Reply With Quote

If it is possible, please, show code fragment where calendar is initialized and form with its pop-up call.
View User's Profile View All Posts By User U2U Member
bethany
Junior Member

Posts: 2
Registered: 3/6/2003
Member Is Offline
posted on 3/6/2003 at 03:52 PM Reply With Quote
No target control specified


Hi.

The code below is where the calender is created after the form tag

</FORM>
<script language="JavaScript">
<!--
var cal1 = new calendar1(document.forms['0'].elements['txtSurveyDate']);
cal1.year_scroll = true;
cal1.time_comp = false;
//there are numerous calenders created here but I have only included one. //-->
</script>
</BODY>


Below is the code where the calender is called in my page.
<input type="Text" name="txtSurveyDate" value="">
<a href="javascript:cal1.popup();">
<img src="../Calender/img/cal.gif" width="16" height="16" border="0" alt="Click here for the date">
</a>

The format of the application is fairly strange so if you can't help it doesn't matter as I will leave it as it is.

Thanks for you help
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 3/7/2003 at 07:42 AM Reply With Quote

That message appears only if there is no form or no input field referred to by initialization. Show, please, form fragment too.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/7/2003 at 08:10 AM Reply With Quote

possible cause is the way you refer the form:
document.forms['0'] means form with name="0"
if you need to refer first form of the document then you should write document.forms[0]
View User's Profile View All Posts By User U2U Member
Doyen
Newbie

Posts: 1
Registered: 10/2/2006
Location: Atlanta, GA
Member Is Offline
posted on 10/2/2006 at 02:25 PM Reply With Quote

I figured out the reason for this error... at least in my case.

Code:

<script language="JavaScript">
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application
var cal6 = new calendar2(document.forms['tstest'].elements['input6']);
cal6.year_scroll = false;
cal6.time_comp = false;
var cal7 = new calendar2(document.forms['tstest'].elements['input7']);
cal7.year_scroll = true;
cal7.time_comp = true;
var cal8 = new calendar2(document.forms['tstest'].elements['input8']);
cal8.year_scroll = false;
cal8.time_comp = true;
//-->
</script>

which ever calendar types you use, you need to remove all the others from the script. I left the lines related to cal7 and cal8 in my script (see above) so I got 2 'No target control specified' errors each time I loaded the page.

After removing those lines, my page loaded properly.

The error was caused in my case because there was no element named input7 or input8 in my form.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004