DocType has thrown my formatting out of the window

Author Message
morpheus83uk

  • Total Posts : 738
  • Scores: 0
  • Reward points : 0
  • Joined: 8/21/2006
  • Status: offline
DocType has thrown my formatting out of the window Sunday, June 05, 2011 11:58 PM (permalink)
0
Hello,
 
After putting some code in to highlight a row with the use of images my formatting as gone to pop. If I remove the DOCTYPE it goes back to normal however soon as the DOCTYPE is put in then it goes wrong. 
 
Does anyone know why this is happening and if so how I can correct it?
 
My Code is below:
 
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head> <title>SearchAD</title> <!-- 
HTA to search AD and perform various user and computer actions 
Also to create, modify and remove users.
Written by James Cartwright
--> <HTA:APPLICATION      APPLICATIONNAME="SearchAD"
     BORDER = "Thin"
     SCROLL = "no"
     SINGLEINSTANCE = "Yes"
     WINDOWSTATE = "Normal"
     SYSMENU = "No"
> <style type="text/css">
.table{ 
  overflow:auto;
  height:210px;
} table.tableRowHover {
width: 600px;
}
table.tableRowHover tr.trHover {
background: url(normal.jpg) no-repeat 0 0;
position: relative;
}
table.tableRowHover tr:hover {
background-position: 0 -68px;
}
table.tableRowHover td {
height: 50px;
background-image: none;
} .general {
 font-family:arial;
 font-style:bold;
 font-size: 16;  } </style>
</head> <script language="VBScript"> Sub Window_onLoad   
 
Set objFSO = CreateObject("Scripting.FileSystemObject")     Me.ResizeTo 670,570
    Me.MoveTo ((Screen.Width / 2) - 200),((Screen.Height / 2) - 250)
    lstValues.Style.Width = 200
    
If objFSO.FileExists("P:\Powershell\temp.csv") Then
 document.getElementById("tblResults").style.visibility ="visible"
 document.getElementById("tblhead").style.visibility ="visible"
Else
document.getElementById("tblResults").style.visibility ="hidden"
document.getElementById("tblhead").style.visibility ="hidden"
End If End Sub Sub SubmitText Set objShell = CreateObject("WScript.Shell")   
Set objFSO = CreateObject("Scripting.FileSystemObject") 
     
If objFSO.FileExists("P:\Powershell\temp.txt") Then
objFSO.DeleteFile("P:\Powershell\temp.txt"),True
End If Set textTemp = objFSO.OpenTextFile("P:\Powershell\temp.txt",8,True) 
    textTemp.WriteLine txtsearch.value
    textTemp.Close
objShell.Run "powershell.exe &'P:\Powershell\QueryAD.ps1'",0,True
window.location.reload()  End Sub
  
Function run Set objShell=CreateObject("Wscript.Shell") Select Case True
 
 Case UnlockUser.Checked
  objShell.Run "powershell.exe -noexit &'C:\UserAdmin\UnlockUser.ps1'",0,True
 Case ChangePW.Checked
  objShell.Run "powershell.exe -noexit &'C:\UserAdmin\ChangePassword.ps1'",0,True
 Case EnableUser.Checked
  objShell.Run "powershell.exe -noexit &'C:\UserAdmin\EnableUser.ps1'",0,True
 Case DisableUser.Checked
  objShell.Run "powershell.exe -noexit &'C:\UserAdmin\DisableUser.ps1'",0,True End Select  End Function
      
Function leave Set objFSO = CreateObject("Scripting.FileSystemObject")
      
If objFSO.FileExists("P:\Powershell\temp.csv") Then
objFSO.DeleteFile("P:\Powershell\temp.csv"),True
End If window.close End Function </script>  <body STYLE="font:14 pt arial; color:white;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='#000033', EndColorStr='#0000FF')">      
    <table width='90%' height = '20%' border='0'>        
            <tr>
                  <td align="center" class="general">
                        <b>Search AD</b>
                  </td>
            </tr>
            <tr>
                  <td align='left' id="lstValues" class="general">
      <br><br>User Search:  <input type="text" name="txtsearch" />
      <input type="submit" value="Submit" onclick="SubmitText" />
    </td>
            </tr>  
   </table>  
      
<object ID=temp classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
  <param nAme="DataURL" value="temp.csv">
  <param nAme="UseHeader" value="true">
</object> <table id="tblhead" cellpadding="3">
<thead>
     <tr><th width="150">Name</th><th width="73%">OU</th></tr>
</thead> 
</table>
<div class="table">
<table id="tblResults" class="tableRowHover" datasrc='#temp' border="1" cellpadding="3">
     <tr class="trHover">
     <td width="150"><span datafld='Name'> </span></td>
     <td><span datafld='ParentContainer'></span></td></tr>
</table>   
</div>
<table>
<col class="general" />
<col span="2" class="general" />
<tr>
 <td><input type="radio" name="usrtools" value="UnlockUser" id="UnlockUser"> Unlock User Account<br>
 <td><input type="radio" name="usrtools" value="ChangePW" id="ChangePW"> Change User Password (Complex)<br> 
</tr>
<tr>
 <td><input type="radio" name="usrtools" value="EnableUser" id="EnableUser"> Enable User Account</td><br>
 <td><input type="radio" name="usrtools" value="DisableUser" id="DisableUser"> Disable User Account</td><br>
</tr> 
</table>  
   <div align="right">              
                     <input type="button" value="Close" name="btn_Close" onClick="vbs:Execute('leave')">
            </div>            
</body>   

Many Thanks
 
James
 
#1
    morpheus83uk

    • Total Posts : 738
    • Scores: 0
    • Reward points : 0
    • Joined: 8/21/2006
    • Status: offline
    Re:DocType has thrown my formatting out of the window Tuesday, June 07, 2011 8:06 PM (permalink)
    0
    Does anyone have any suggestions on this?
     
    Many Thanks
     
    James
     
    #2
      TNO

      • Total Posts : 2094
      • Scores: 36
      • Reward points : 0
      • Joined: 12/18/2004
      • Location: Earth
      • Status: offline
      Re:DocType has thrown my formatting out of the window Tuesday, June 14, 2011 3:28 AM (permalink)
      0
      http://pastebin.com/HzgY38gs
       
      Your doctype expects xml format, but your markup is not:

      line 1: <html> is missing: xmlns="http://www.w3.org/1999/xhtml"

      <head> is missing: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


      line 16: unclosed tag />
      line 27: misspelled

      line 43: use type="text/vbscript" instead of language="vbscript"
      move this tag into the <head> tag

      line 44: add Option Explicit

      line 95: move the style information into the stylesheet
      line 96: replace attributes with styles
      line 98: replace align with a style in stylesheet
      line 99: replace <b> with a style
      line 103: same as line 98
      line 104: <br unclosed. These could be replaced with css
      <input should have an id attribute and the VBScript should use that id instead of the name
      line 105: input could be replaced by a <button type="submit">
      onclick should not be explicit on this tag. put it in the vbscript
      line 109: id should be lowercase and the value quoted
      line 110, 111: attributes names should be lowercase and the tags closed: />
      line 113: move cellpadding to stylesheet
      line 116: move width to stylesheet
      line 117: ditto
      line 122: move border and cellpadding to stylesheet
      line 124: move width to stylesheet
      line 133, 134: <td> and <br> are unclosed
      line 133, 134, 137, 138: <input> is unclosed
      line 141: replace align with a stylesheet property
      line 142: <input> is unclosed. Could be replaced with a <button> tag, should use an ID instead of a name. onclick should not be explicit, move to vbscript
      line 145: missing </html>
      To iterate is human, to recurse divine. -- L. Peter Deutsch
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9