[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8884
  • Last Modified:

ASP transitional validation errors

I am trying to modify the asp code in Visual Basic.  I have encountered many errors today.  Luckily I've found solved most of them but I have several that still are unsolved!  Can someone look at the errors and show me the correct way the code is supposed to be written.  

Here are the errors:
       1) validation(XHTML 1.0 Transitional) Element 'tr' cannot be nested with element 'body'
       2) validation(XHTML 1.0 Transitional) Attribute 'margin-left' is not a valid attribute of element 'input'
        3) validation(XHTML 1.0 Transitional) Attribute 'border-style' is not a valid attribute of element 'input'
       4) validation(XHTML 1.0 Transitional) Attribute 'style' can be specified only once in a tag
       5) validation(XHTML 1.0 Transitional) Attribute 'align' is not a valid attribute of element 'input'


Thank you for your help!
-d
0
spinone_owner
Asked:
spinone_owner
  • 5
  • 3
  • 2
  • +1
3 Solutions
 
BogoJokerCommented:
Here goes:

1) validation(XHTML 1.0 Transitional) Element 'tr' cannot be nested with element 'body'

A <tr> [table row] tag should not be directly in the <body>.  It should be inside of a <table> element!  You are most likely missing the <table> tag, or you don't want a <tr>, maybe you want a <br />.

2) validation(XHTML 1.0 Transitional) Attribute 'margin-left' is not a valid attribute of element 'input'
3) validation(XHTML 1.0 Transitional) Attribute 'border-style' is not a valid attribute of element 'input'
5) validation(XHTML 1.0 Transitional) Attribute 'align' is not a valid attribute of element 'input'

All three of these are the same.  You have attributes on an element that should not be on the element.  Al of the above are CSS properties and they should all be in the style attribute of your element (or in a CSS stylesheet).  Something that looks like:
<input type="text" margin-left="2px" border-style="solid" align="left" />
Should have all of those attributes in the style attribute like so:
<input type="text" style="margin-left: 2px; border-style: solid; text-align: left;" />

4) validation(XHTML 1.0 Transitional) Attribute 'style' can be specified only once in a tag
Somewhere the style attribute of an element is set more then once.  Something like:
<p style="color: blue;" style="border: 1px solid red;">
Should just have a single style attribute like so:
<p style="color: blue; border: 1px solid red;">

Hope that helps,
- Joe P
0
 
bugs021997Commented:
Most of the errors above are actually not compile errors, but rather HTML validation errors (right now you are validating for XHTML -- and your pages aren't XHTML compliant).  You can turn this off by going to tools->options and under the text editor->html->validation option disable validation.  This will cause almost all of these errors to disappear.

Also try changing the Target Schema for validation dropdown value to IE6. You can find this dropdown in the HTML Source Editing toolbar


Cheers
 ^_^
BUGS
0
 
jrm213jrm213Commented:
Hi,

bugs is right, those are html validation issues. You have specified a doctype of XHTML 1.0 Transitional and your HTML does not conform to that standard. In most cases it looks like you are mixing CSS styles into html attributes.

It would be helpful to see the code but here are the resolutions as I see them

1. You either forgot the <table> tag around your <tr> tags, or you meant to have a <tbody> tag inside your <table> tag and you forgot the "t" in the tag name so it thinks it is a <body> tag.

2. margin-left can not be part of the <input> tag. Add it into the style of the tag. so
<input type="text" id="txtinput" margin-left="10px"/> is not valid html
<input type="text" id="txtinput" style="margin-left: 10px;"/> is valid html

3. border-style can not be part of the <input> tag. Add it into the style of the tag.
<input type="text" id="txtinput" border-style="solid"> is not valid html
<input type="text" id="txtinput" style="border: 1px solid black;"> is valid html

4. in some tag, somewhere, hopefully the error has a line number associated with it, you have specified the "style" attribute more than once. Ex.
<input type="text" style="border: 1px solid black;" style="background-color: #000000;"/>
instead, combine the 2 style tags into one style tag
<input type="text" style="border: 1px solid black; background-color: #000000;"/>

5. align can not be part of the <input> tag. Add it into the style of the tag.
<input type="text" id="txtinput" align="left"> is not valid html
<input type="text" id="txtinput" style="text-align: left;"> is valid html


Hope that helps, good luck finding and fixing the issues.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
spinone_ownerAuthor Commented:
I've still got to look at the code and make the modifications.   Here is the code as it stands.  I have 21 errors within this code.  They are the five errors I listed above.  Thanks for you help.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>Frequency Input
</title><link href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css" rel="stylesheet" type="text/css" /><link href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css" rel="stylesheet" type="text/css" /></head>
<body bgcolor="#dfedff">
    <form name="form1" method="post" action="freqinput.aspx" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
</div>

<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
// -->
</script>


<div style="text-align: center"/>
        <img alt="Image1" title="YAt Intranet" src="YATLogo.jpg" style="height:40px;width:150px;border-width:0px;" />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
        &nbsp;<strong> &nbsp; &nbsp;</strong><span style="font-size: 24pt"/><strong> &nbsp; &nbsp;
            Die Status Reports<br />
        </strong><span style="font-size: 12pt; text-decoration: underline"> </span>
       
          <br />
            <br />
 <strong></strong>  
  <asp:panel id="Panel1" runat="server" borderstyle="solid" BorderWidth="1px" Height="24px" Width="631px">
 
      
                <a id="HyperLink3" href="home.aspx" style="font-size:10pt;">Home</a>&nbsp;
                &nbsp;<a id="HyperLink4" href="assembly.aspx" style="font-size:10pt;">Assembly</a>
                &nbsp;
                <a id="HyperLink5" href="stamping.aspx" style="font-size:10pt;">Stamping</a>
                &nbsp;
                <a id="HyperLink6" href="assembly.aspx" style="font-size:10pt;">PM</a>
                &nbsp;
                <a id="HyperLink7" href="stamping.aspx" style="font-size:10pt;">Tool & Die</a>
                &nbsp;
                <a id="HyperLink8" href="home.aspx" style="font-size:10pt;">Human Resources</a>
                &nbsp;
                <a id="HyperLink9" href="stamping.aspx" style="display:inline;font-size:10pt;width:102px;">Material Control</a>&nbsp;
                <a id="HyperLink10" href="home.aspx" style="font-size:10pt;">MIS</a>&nbsp;
                <a id="HyperLink11" href="stamping.aspx" style="font-size:10pt;">Various</a></asp:panel>
</form>
           
   
   &nbsp ; <br />
            Top 20 by Frequency&nbsp;<br />
            <span style="font-size: 12pt"><strong>Enter the specific dates for the frequency report:<br />
            </strong>
                Start Date:&nbsp; </span>
            <asp:textbox id="txtstart" runat="server" ValidationGroup="yyyy/mm/dd"> </asp:textbox> <span style="font-size: 12pt"/>
                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; End Date:&nbsp; &nbsp;<asp:textbox id="txtend" runat="server"></asp:textbox><br />
                <br />
                &nbsp;
                <input type="submit" name="btnfreqrpt" value="Frequency Report" id="btnfreqrpt" /><br />
                <br />
               
<link rel="stylesheet" type="text/css" href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css"/>
<table id="mycrystalreportviewer" cellpadding="0" cellspacing="0" style="display:inline;height:826px;width:600px;"/>
  <tr><td></td></tr>
<div style="width: 600px; height: 826px;position:relative"/>
      <input name="mycrystalreportviewer$ctl01" type="hidden"/>
<script type="text/javascript" language="Javascript">
var decimalSep =".";
var groupSep = ",";
</script>
<span class="" style="border-style:None;">The report you requested requires further information.</span></></>
<p></p>
<hr class="" style="border-style:None;"/>
<script type="text/javascript" language="JavaScript" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/js/KeyDownEvent.js"></script>
<script type="text/javascript" language="JavaScript" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/js/strings_en.js"></script>
<script type="text/javascript" language="JavaScript" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/js/dt_param.js"></script>
<script type="text/javascript" language="JavaScript" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/js/prompts_param.js"></script>
<script type="text/javascript" language="JavaScript" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/js/calendar_param.js"></script>
<script type="text/javascript" language="JavaScript">
function submitParameterValues()
{
    if (prepareParameterSubmit())
       javascript:__doPostBack('mycrystalreportviewer$ctl01','crprompt=param');
}
function prepareParameterSubmit()
{
  var inform = document.getElementById("form1");
  return setPromptValues ( inform );
}
</script>
<p><span class="" style="border-style:None;">Parameter Field(s)</span></p>
<table cellspacing='0' cellpadding='0' style=''/>  <tr><td colspan='2' nowrap="nowrap"> <span class="" style="border-style:None;"> Please enter the start date </span> </td></tr>
  <tr style="padding-top:2px"><td align="Left" valign="top" nowrap="nowrap" style="padding-top:4px"> <span class="" style="border-style:None;"> Value&nbsp;  </span> </td>
      <td nowrap="nowrap"><input class="" border-style=["Inset"],["2px"];margin-left= "2px";  type="text" name="StartDate0DiscreteValue" value="" readonly="readonly" maxlength="255" style="width:200px"/><input type="hidden" name="StartDate0DiscreteValueHidden" value="" /><a style="margin-left:2px;margin-right:2px" href="javascript:doNothing()" onclick="DateTimeFormat=false;setDateField('form1', 'StartDate0DiscreteValue', 'StartDate0DiscreteValueHidden');top.newWin = window.open('/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/html/calendar.html','cal','resizable=yes,dependent=yes,width=230,height=240,screenX=200,screenY=300,titlebar=yes')"><img alt="Calendar" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/images/toolbar/calendar.gif" border="0"/></a></><script type="text/javascript"language="javascript" >document.write(CreateTimeEditables("StartDate0", "DiscreteValue", true, "", "", 0, 0, 0));</script>
 
</td>
  </tr>
  <tr style="padding-top:2px"><td align="Left" valign="top" nowrap="nowrap" style="padding-top:4px"> <span class="" style="border-style:None;">  </span> </td>
      <td nowrap="nowrap"></td></tr>
 <tr><td nowrap="nowrap" height='15' colspan='2'></td></tr>  <tr><td colspan='2' nowrap="nowrap"> <span class="" style="border-style:None;"> Please enter the end date </span> </td></tr>
  <tr style="padding-top:2px"><td align="Left" valign="top" nowrap="nowrap" style="padding-top:4px"> <span class="" style="border-style:None;"> Value&nbsp;  </span> </td>
      <td nowrap="nowrap"><input class="" style="border-style:Inset;border:[2px];margin-left:2px;"  type="text" name="EndDate1DiscreteValue" value="" readonly="readonly" maxlength="255" style="width:200px"/><input  type="hidden" name="EndDate1DiscreteValueHidden" value=""/><a style="margin-left:2px;margin-right:2px" href="javascript:doNothing()" onclick="DateTimeFormat=false;setDateField('form1', 'EndDate1DiscreteValue', 'EndDate1DiscreteValueHidden');top.newWin = window.open('/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/html/calendar.html','cal','resizable=yes,dependent=yes,width=230,height=240,screenX=200,screenY=300,titlebar=yes')"><img alt="Calendar" src="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/images/toolbar/calendar.gif" border="0"/></a></><script type="text/javascript" language="javascript" >document.write(CreateTimeEditables("EndDate1", "DiscreteValue", true, "", "", 0, 0, 0));</br></script>
 
</td>
  </tr>
  <tr style="padding-top:2px"><td align="Left" valign="top" nowrap="nowrap" style="padding-top:4px"> <span class="" style="border-style:None;">  </span> </td>
      <td nowrap="nowrap"></td></tr>
 <tr><td nowrap="nowrap" height='15' colspan='2'></td></tr>  <tr><td colspan='2' nowrap="nowrap"> <span class="" style="border-style:None;">    </span> </td></tr>
  <tr style="padding-top:2px"><td align="Left" valign="top" nowrap="nowrap" style="padding-top:4px"> <span class="" style="border-style:None;"> Value&nbsp;  </span> </td>
      <td nowrap="nowrap"><input class="" style="border-style:Inset;border:[2px];margin-left:2px;"  type="text" name="2DiscreteValue" value=""  maxlength="255" style="width:200px"/><input  type="hidden" name="2DiscreteValueHidden" value="" /><br/>
 
</td>
  </tr>
  <tr style="padding-top:2px"><td align="Left" valign="top" nowrap="nowrap" style="padding-top:4px"> <span class="" style="border-style:None;">  </span> </td>
      <td nowrap="nowrap"></td></tr>
 <tr><td nowrap="nowrap" height='15' colspan='2'></td></tr><!-- hidden fields -->
<input type="Hidden" name="promptex-StartDate0" value=""/><input type="Hidden" name="promptex-EndDate1" value=""/><input type="Hidden" name="promptex-2" value=""/><!-- setting functions for each parameter -->
<script type="text/javascript">
var isAlreadySubmitted = false;
function setPromptValues ( inform )
{
  if(!setPromptSingleValue(inform, "dt","StartDate0")) return false;
  if(!setPromptSingleValue(inform, "dt","EndDate1")) return false;
  if(!setPromptSingleValue(inform, "text","2")) return false;
  if ( isAlreadySubmitted )scr
    return false;
  isAlreadySubmitted = true;
  return true;
}
</script>
<div>
 <table>
  <tr><td></td><td align='Right'>
    <input class="" style="border-style:Outset;border:[2px];margin-left:2px;" align='center'type="button" value="Submit" onclick="javascript:submitParameterValues()"/>
  </td></tr>
</table>



               
   &nbsp;&nbsp;
  <span></span></div>
   
<div id="mycrystalreportviewer_ctl01">

      <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAKvst6wCALE2qDzBgKG+5Y+As2vvc8BnaMv1fA0I9j9ljGHcjSOi35JA/Q=" />
</div>
</body>
</html>
0
 
bugs021997Commented:
@spinone_owner

Did you try what i had suggested ?
0
 
spinone_ownerAuthor Commented:
Bugs-  
    Yes, I finally figured out the exact place you were speaking of.    (it was worded differently)  I turned it off all but one error disappeared.  When I built and complied the page at go this error:

Control 'txtstart' of type 'TextBox' must be placed inside a form tag with runat=server.

Any suggestions to fix this?
Thanks for you help.
0
 
spinone_ownerAuthor Commented:
When I go to switch to design view (visual studio 2005) the errors come back and it will not let me switch views.  
0
 
spinone_ownerAuthor Commented:
Ok I'm down to two errors.  I got the code fixed to stop that control error.  Yet I still need to switch to design view to get a few things straight.  There are a few remaining errors keeping me for switching over.

The following code is giving me an error:

1)
<link rel="stylesheet" type="text/css" href="/aspnet_client/System_Web/2_0_50727/CrystalReportWebFormViewer3/css/default.css"/>
     Error: Element link cannot be nested within element 'body'
2)
<body bgcolor="#dfedff">
     Error:  Text is not allowed between opening / closing tags for element body

Thanks!
0
 
jrm213jrm213Commented:
1. Put the <link> tag in the <head> not in the <body>.
2. I am not sure, that definitely looks valid. Try fixing the link issue and see if it resolves the body issue.
0
 
spinone_ownerAuthor Commented:
The body error did not go away, but it was able to switch to design view.  I then could readd my crystal report viewer.  Yet I crysal report source is throwing an errors.  1) Unknown server tag CR:CrystalReportViewer 2) Unknown server tag CR:CrystalReportSource.  
                  Here is the code:

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
        Height="812px" ReportSourceID="freqreport" Width="1199px" />
    <CR:CrystalReportSource ID="freqreport" runat="server">
        <Report FileName="freqfinal.rpt">
        </Report>
    </CR:CrystalReportSource>

0
 
jrm213jrm213Commented:
Hmm...

I don't know what to tell you about that. I have never used Crystal Reports Viewer on a web page. It might be better to post that as a question in another section (ASP.NET, C# or VB.NET, Crystal Reports...) The only thing I can think is that something is not referenced properly in the .Net Project.



0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now