Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Problem with validation within XML Data Island bound tables

Reply
Thread Tools

Problem with validation within XML Data Island bound tables

 
 
Dnna
Guest
Posts: n/a
 
      11-26-2003
I have a table which is bound to an xml data island. I'm using
ASP.Net's client-side validators for an input field in the table. The
problem is that if the table is bound, the validators do not work. If
the table is Not bound, the validators do work, but then I don't have
the table iterating through all the elements in my xml island. Any
suggestions?
Here is the generated code for my table:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Patient Visits</TITLE>
</HEAD>
<BODY>
<H1>Patient Visits</H1>
<XML ID="VisitsDSO">
<visits>
<visit>
<number>1</number>
<height>111</height>
<weight>100</weight>
<date>1999-01-01</date>
</visit>
<visit>
<number>2</number>
<height>222</height>
<weight>200</weight>
<date>2000-01-01</date>
</visit>
<visit>
<number>3</number>
<height>333</height>
<weight>300</weight>
<date>2001-01-01</date>
</visit>
<visit>
<number>4</number>
<height>444</height>
<weight>400</weight>
<date>2002-01-01</date>
</visit>
<visit>
<number>5</number>
<height>555</height>
<weight>500</weight>
<date>2003-01-01</date>
</visit>
</visits>
</xml>


<form name="_ctl0" method="post" action="PatientVisits.aspx"
language="javascript" onsubmit="ValidatorOnSubmit();" id="_ctl0">
<input type="hidden" name="__VIEWSTATE"
value="dDwtNDg3NzIxNjA3Ozs+LcqNO2ytHf6sg9tZGopQzt1 vegQ=" />

<script language="javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>
<TABLE datasrc="#VisitsDSO" BORDER="1">
<THEAD>
<TR>
<TH>
Visit</TH>
<TH>
Date</TH>
<TH>
Height</TH>
<TH>
Height</TH>
<TH>
Weight</TH>
</TR>
</THEAD>
<TR>
<TD VALIGN="top">
<SPAN DATAFLD="number"></SPAN>
</TD>
<TD VALIGN="top"><input name="TextBox2" id="TextBox2" type="text"
datafld="Date" />
<span id="Requiredfieldvalidator4" controltovalidate="TextBox2"
errormessage="<br>Empty Field" display="Dynamic"
evaluationfunction="RequiredFieldValidatorEvaluate IsValid"
initialvalue="" style="color:Red;display:none;"><br>Empty Field</span>
<span id="Comparevalidator1" controltovalidate="TextBox2"
errormessage="<br>Please enter a whole number greater than or equal to
12345." type="Integer"
evaluationfunction="CompareValidatorEvaluateIsVali d"
valuetocompare="12345" operator="GreaterThanEqual"
style="color:Red;visibility:hidden;"><br>Please enter a whole number
greater than or equal to 12345.</span>
</td>
</TR>
</TABLE>


<script language="javascript">
<!--
var Page_Validators = new
Array(document.all["Requiredfieldvalidator1"],
document.all["Comparevalidator2"],
document.all["Requiredfieldvalidator4"],
document.all["Comparevalidator1"]);
// -->
</script>


<script language="javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" &&
clientInformation.appName.indexOf("Explorer") != -1) {
if (typeof(Page_ValidationVer) == "undefined")
alert("Unable to find script library
'/aspnet_client/system_web/1_1_4322/WebUIValidation.js'. Try placing
this file manually, or reinstall by running 'aspnet_regiis -c'.");
else if (Page_ValidationVer != "125")
alert("This page uses an incorrect version of
WebUIValidation.js. The page expects version 125. The script library
is " + Page_ValidationVer + ".");
else
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
ValidatorCommonOnSubmit();
}
}
// -->
</script>


</form>
</BODY>
</HTML>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to represent the data in a not bound control via bound control Mario Krsnic ASP .Net 0 06-23-2006 07:38 AM
Tables within tables Otuatail HTML 7 08-02-2004 04:42 AM
Persist data in XML data island Pat Alessi ASP .Net 3 05-26-2004 02:07 PM
Web control that acts as a xml data island Mark Goldin ASP .Net 1 04-29-2004 12:20 PM
Access xml data Island from C# code =?Utf-8?B?TWFyaw==?= ASP .Net 0 04-27-2004 08:46 PM



Advertisments