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
aemomsen
Junior Member

Posts: 3
Registered: 4/9/2003
Member Is Offline
posted on 4/9/2003 at 01:46 AM Reply With Quote
no target control specified


page has 11 dynamically generated text boxes with calendars, get a no target control specified for each object, and when you click on the calendar icons, get a this.target.value is null or not an object error.

<table border=0 align=center columns =3 width = 500 >
<tr><td colspan=3 align=center></td>
<tr><td valign=top align=center><img src=/img/pixel.gif width=1 height=40 border=0><br>

<form name=tstest>
<input type=Text name=1 size=20 value=>CREATED
<a href=javascript:cal1.popup();><img src=img/cal.gif width=16 height=16></a><br></td></tr></form>
<script language="JavaScript">
<!--
var cal1 = new calendar2(document.forms['tstest'].elements[1]);
cal1.year_scroll = false;
cal1.time_comp = true;
//-->
</script>

<input type=Text name=2 size=20 value=>SERVICE DATE
<a href=javascript:cal2.popup();><img src=img/cal.gif width=16 height=16></a><br></td></tr></form>
<script language="JavaScript">
<!--
var cal2 = new calendar2(document.forms['tstest'].elements[2]);
cal2.year_scroll = false;
cal2.time_comp = true;
//-->
</script>
View User's Profile View All Posts By User U2U Member
aemomsen
Junior Member

Posts: 3
Registered: 4/9/2003
Member Is Offline
posted on 4/9/2003 at 02:22 AM Reply With Quote
the actual code snippet that generates the html


sql = "select StatusID, StatusDesc from MD_Statuses order by StatusID"
response.write "<table border=0 align=center columns =2 width = 500 >"
response.write "<tr><td colspan=2 align=center></td>"
response.write "<tr><td valign=top align=center>"
response.write "<img src=/img/pixel.gif width=1 height=40 border=0><br>"
response.write "<form name='tstest'>"
command.CommandText=sql
set rs = command.Execute()
Do While Not rs.EOF
StatusID = rs("StatusID")
StatusDesc = rs("StatusDesc")
response.write "<input type=Text name=" & StatusID & " size=20 value=>" & StatusDesc:
response.write "<a href=javascript:cal" & StatusID & ".popup();><img src=img/cal.gif width=16 height=16></a><br></td></tr></form>"
%><script language="JavaScript">
<!--
var cal<%=StatusID%> = new calendar2(document.forms['tstest'].elements[<%=StatusID%>]);
cal<%=StatusID%>.year_scroll = false;
cal<%=StatusID%>.time_comp = true;
//-->
</script></a><%


rs.MoveNext
loop
rs.close
set rs = nothing
response.write "</table>"
View User's Profile View All Posts By User U2U Member
nik


Posts:
Registered: 1/1/1970
Member Is Offline
posted on 4/9/2003 at 09:08 AM Reply With Quote

This happens because you've closed <form> tag just after the first <input> tag. As you have 11 objects you should close <form> tag after all form elements. To avoid another problems you should remember that all DHTML collection are zero-based indexed and number reference to a collection element will not always refer to the same as when we quote them. That's why either insert before first <input type=Text name=1 size=20 value=> hidden tag <input type=hidden value=''> or refer starting from zero. Of course, it's more preferable to refer by name because you can easily genarate names by ASP.
View User's Profile View All Posts By User U2U Member
aemomsen
Junior Member

Posts: 3
Registered: 4/9/2003
Member Is Offline
posted on 4/9/2003 at 02:45 PM Reply With Quote
nik: Thank you


You are brilliant, and I am known for stupid mistakes. It is working now. Thank you again, especially for the fast response.

Alisa
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