...

View Full Version : W3C validation problems



CaptainB
07-03-2007, 02:22 PM
Hi!

When I validate my page: direct link to validator (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fmain-layout.php) I get ie this error:


Error Line 20 column 47: document type does not allow element "a" here.
menu1[1]='<a href="http://www.freewarejava.com">Browse Files</a>'

This is my code for the following error:


menu1[0]='<a href="http://www.javascriptkit.com">New Files</a>'

What should I write there instead of a? As far as I know it won't work without the "a"..?
------------------------------
Also I get following error:


Warning Line 96 column 20: character "&" is the first character of a delimiter but occurred as data.
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")

This is my code for the following error:


if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")

If I remove 1 of the "&" I get an error too. But if they arn't there my script dosn't work. What should I do?
------------------------------
One error more I get is this:


Error Line 184 column 934: duplicate specification of attribute "onmouseover".
... event, menu3, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Gal

This is my code for the following error:


<img src="knapper/Gallery.gif" alt="Gallery" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu4, '165px')" onmouseover="delayhidemenu()"/>

I have several of the following lines, as there are more buttons. But I need to write the tag to every button or it won't work. What do I do?

Cheers!

whizard
07-03-2007, 02:30 PM
put all the JS functions you want to run in one onmouseover attribute, and separate them with semicolons:

<img src="knapper/Gallery.gif" alt="Gallery" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu4, '165px');delayhidemenu()" />

HTH
Dan

CaptainB
07-03-2007, 02:41 PM
Hmm...When I replace it with the code you provided the menu won't stay out (it's a drop-out menu), but dissapears in 1 sec or less, even though I have the mouse over the button.

_Aerospace_Eng_
07-03-2007, 04:42 PM
Just move your JS to an external file and call it using

<script type="text/javascript" src="urltoexternalfile.js"></script>

And when using an xhtml doctype you need to close all tags. However an image tag has no closing tag so you need to self close it.

This is correct

<img src="blah.jpg" alt="" />
This is not

<img src="blah.jpg" alt="">

You could also use the second method if you were using an HTML doctype.

CaptainB
07-04-2007, 01:53 PM
Thanks, that corrected a whole bunch of errors :)

About the javascript file, should I just put all my scripts in it? How would I then link to each of the different scripts? Like how would I come around this:


<div id="clock">
<script language="JavaScript">
function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinute s(),tN().getUTCSeconds()); x.setTime(x.getTime()); return x; }
function tN(){ return new Date(); }
function lZ(x){ return (x>9)?x:'0'+x; }
function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; }
function dT(){ if(fr==0){ fr=1; document.write('<font size="2" face="tahoma" color="#D6D5D5"><b><span id="tP">'+eval(oT)+'</span></b></font>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }
var mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="tS().getDate()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+' '+'Z'+'u'+'l'+'u'";
</script>
<script language="JavaScript">dT();</script>
</div>

What should I put in the DIV to display the clock then?

BWiz
07-04-2007, 06:23 PM
You would just reference them as your would normally...just place this in between the <head> tags


<script type="text/javascript" src="scripts/js/filename.js"></script>


Then just call them normally:


<script type="text/javascript">dT();</script>

The function in the div calls the functions, all you have to do is this:


<div><script type="text/javascript">dT();</script></div>

CaptainB
07-04-2007, 06:46 PM
First, does the file have to be located in scripts/js/filename.js ?

Because now I have put ALL my scripts in a file called "javascripts.js" located in the same folder as my website and it's files.

However when I include the sentence:


<script type="text/javascript" src="javascripts.js"></script>

between the <head> and </head> tags and then place this code:


<script type="text/javascript">dT();</script>

between my <div id="clock"></div> nothing happens..Also my dropout-menu dosn't work. What have I done wrong?

BWiz
07-04-2007, 07:23 PM
Hmm, odd, can you show your code?

CaptainB
07-04-2007, 08:17 PM
Sure

Here goes the main page:


<?php include("lp_source.php"); ?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Home - XflightX - You are cleared to land...</title>
<link href="teststyle.css" rel="stylesheet" type="text/css" />
<link href="calendar/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="javascripts.js"></script>


</head>

<body>
<div id="container">
<!-- MENU -->
<div id="header"><img src="NEW2.jpg" alt="XflightX Banner" width="981" /></div>
<div id="content">
<div id="infoleft">
<div id="uppermenu"></div>
<div id="menu"><img src="knapper/Home.gif" alt="Home" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" /><img src="knapper/Downloads.gif" alt="Downloads" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu1, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Guestbook.gif" alt="Guestbook" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu2, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/FlightClub.gif" alt="Flight Club" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu3, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Gallery.gif" alt="Gallery" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu4, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Forums.gif" alt="Forums" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu5, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Contact.gif" alt="Contact" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu6, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Links.gif" alt="Links" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu7, '168px')" onmouseover="delayhidemenu()"/><img src="knapper/KnowledgeBase.gif" alt="Knowledge Base" style="border-top-width:1px; border-bottom-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu8, '165px')" onmouseover="delayhidemenu()"/><img src="knapper/Design.gif" alt="Design" style="border-top-width:1px; border-bottom-width:1px; border-right-width:0px; border-left-width:0px; border-style:solid;" onmouseover="dropdownmenu(this, event, menu9, '165px')" onmouseover="delayhidemenu()"/></div><div id="lowermenu">
</div>
<!-- MENU END -->
<!--CALENDAR -->
<div id="calender"><h1>Calendar</h1>
<?php include('calendar/calendar.php');
$calendar = new WingedCalendar();

// to display a single calendar
$calendar->show_calendar();

// where PREVIOUS and NEXT are the number of months
// before and after the current month respectively.
?><h2><b>Feel free to add things</b></h2>
</div>
<!-- CALENDAR END -->
<!-- LEFT SIDE BOXES -->
<div id="box_partners"><h1>Partners</h1><a href="http://www.freedomain.co.nr/" target="_blank"><img src="partners/co.nr.gif" alt="co.nr domains" width="150" height="30" border="0" /></a>
<a href="http://www.mysafetycards.piczo.com" target="_blank"><img src="partners/mysafetycards.gif" alt="Mysafetycards" width="150" height="30" border="0" /></a>
<a href="http://www.worldwidetopsites.com/php/in.php?id=Kasio" target="_blank"><img src="partners/topsitesvote.gif" alt="Vote for XflightX" width="150" height="30" border="0" /></a></div>
</div>
<div id="main">

<center><?PHP
$number=5;
include("/home/sites/port10.com/public_html/xflightx/test/cutenews/show_news.php");
?>
<a href="cutenews/search.php" target="_blank">Search news</a></center>
</div>
<!-- LEFT SIDE BOXES END -->
<div id="inforight">
<!-- CLOCK -->
<div id="clock">
<script type="text/javascript">dT();</script>
</div>
<!-- CLOCK END -->
<!-- RIGHT SIDE BOXES -->
<div id="box_welcome"><h1>Welcome</h1>
<h2>Hi and welcome to <b>XflightX!</b>
<br />
The site has now got an "extreme makeover", so feel free to browse around and see what's new!
Enjoy your stay and please feel free to <br /><a href="contact.php">contact me</a><br /> if you have any queries.</h2>
</div>
<!-- WEATHER -->
<div id="weather"><h1>Weather</h1><div id="paddingdiv">
<form name="frm" method="post" action="http://adds.aviationweather.noaa.gov/metars/index.php" target="popup" onsubmit="return createPopup(this.target);">
<input size="14" name="station_ids" type="text" style="font-size: 8pt; font-family: Arial" value="Enter ICAO" />
<br />
<input type="radio" name="std_trans" value="standard" checked=""/> Raw Format
<br />
<input type="radio" name="std_trans" value="translated"/> Translated
<br />
<input type="checkbox" name="chk_metars" checked/> METARs
<input type="checkbox" name="chk_tafs"/> TAFs
<br />
<select name="hoursStr">
<option selected> most recent only</option>
<option> past 1 hours</option>
<option> past 2 hours</option>
<option> past 3 hours</option>
<option> past 4 hours</option>
<option> past 5 hours</option>
<option> past 6 hours</option>
<option> past 12 hours</option>
<option> past 18 hours</option>
<option> past 24 hours</option>
<option> past 36 hours</option>
</select>
<br />
<br />

<input name="btnSubmit" style="font-size: 8pt; font-family: Arial" type="submit" value="Submit" />
<input type="reset" style="font-size: 8pt; font-family: Arial" value="Reset Form" />
</form></div></div>
<!-- WEATHER END -->
<!-- FORUM TOPICS BEGIN -->
<div id="box_poll"><h1>Poll</h1>
<div id="paddingdiv1"><h2><?php echo($question); ?>
<br />
<?php if($votingstep==1) { echo($step1str); }
if($votingstep==2) { echo($step2str); }
if($votingstep==3) { echo($step3str); }?>
Total votes: <?php echo($totalvotes); ?></h2></div>
</div>
<!-- FORUM TOPICS END -->
</div>
<!-- RIGHT SIDE BOXES END -->
</div>
<div id="footer"><h3> 2007 - XflightX | All Rights Reserved</h3></div>
</div>





</body>
</html>

Stylesheet:


/*DO NOT CHANGE - MAIN LAYOUT BEGIN*/
body { background-color:#333333;
margin-top:0px;
margin-left:auto;
margin-right:auto;
}

#container {
width:981px;
margin-left:auto;
margin-right:auto;
border-style:solid;
border-width:1px;
border-color:#000000;
}

#header {
float:left;
}

#inforight {
width: 150px;
float: left;
margin-left:5px;
margin-top:10px;
}

#main {
background-color:#666666;
width: 655px;
float: left;
margin-top:10px;
border-style:solid;
border-width:1px;
border-color:#000000;
padding:5px;
text-align:center;
}

#infoleft {
width:150px;
float:left;
margin-right:5px;
margin-top:10px;
}


#footer { background-image:url("Footer.gif");
float:left;
width:981px;
height:63px;
}


h1 { width:150px;
font-family:Arial;
font-weight:bold;
font-size:12px;
color:#FFFFFF;
background-color:#000000;
text-align:center;
margin:0px;
padding:0px;
}


h2 { font-family:Arial;
font-weight:normal;
font-size:12px;
color:#000000;
text-align:center;
padding-left:5px;
padding-right:5px;
padding-top:0px;
pading-bottom:1px;
margin-top:0px;
margin-bottom:0px;
}


h3 { font-family:arial;
font-size:10px;
text-align:center;
font-weight:bold;
margin-top:31px;
}



a { color:#FFFFFF;
text-decoration:none;
}


#uppermenu { background-color:#C8C8C8;
width:150px;
height:10px;
border-style:ridge;
border-width:1px;
font-size:1px;
}


#lowermenu { background-color:#C8C8C8;
width:150px;
height:10px;
border-style:ridge;
border-width:1px;
font-size:1px;
}


#menu { margin-left:5px;
height:100%;

}


#dropmenudiv{
position:absolute;
background-color: #000000;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Arial;
line-height:18px;
z-index:100;
filter:alpha(opacity=70);
-moz-opacity:.70;
opacity:.70;

}


#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
font-weight: bold;
color:#FFFFFF;
}


#dropmenudiv a:hover{ /*hover background color*/
background-color: #979797;
}


#calender { background-image:url("box_bg.gif");
width:150px;
margin-top:10px;
margin-bottom:0px;
border-width:1px;
border-left-width:0px;
border-style:solid;
border-color:#000000;
}


#clock { background-image:url("box_bg.gif");
width:150px;
border-width:1px;
border-style:solid;
border-color:#000000;
margin-bottom:10px;
text-align:center;
}


#weather { background-image:url("box_bg.gif");
width:150px;
font-family:arial;
font-size:8pt;
color:#000000;
margin-bottom:10px;
border-width:1px;
border-style:solid;
border-color:#000000;
}


#paddingdiv { padding-left:8px;
}

#paddingdiv1 { padding-top:2px;
padding-right:3px;
padding-left:3px;
}
/*DO NOT CHANGE - MAIN LAYOUT END*/
/*CONTENT LEFT SIDE BEGIN*/
#box_partners { background-image:url("box_bg.gif");
width:150px;
margin-top:10px;
margin-bottom:0px;
text-align:center;
border-width:1px;
border-left-width:0px;
border-style:solid;
border-color:#000000;
}
/*CONTENT LEFT SIDE END*/
/*CONTENT RIGHT SIDE BEGIN*/



#box_welcome { background-image:url("box_bg.gif");
width:150px;
margin-bottom:10px;
border-width:1px;
border-style:solid;
border-color:#000000;
}


#box_poll { background-image:url("box_bg.gif");
width:150px;
margin-bottom:10px;
border-width:1px;
border-style:solid;
border-color:#000000;
}



/*CONTENT RIGHT SIDE END*/

And the javascripts.js file:


<script type="javascript">
function createPopup(popupName){
var w = window.open("", popupName, "width=600,height=500,toolbar=no,location=no,statusbar=no,menubar=no,resizable=no");
w.focus();
return true;
}
</script>

<script type="text/javascript">
//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.javascriptkit.com">New Files</a>'
menu1[1]='<a href="http://www.freewarejava.com">Browse Files</a>'
menu1[2]='<a href="http://codingforums.com">Search Files</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://www.javascriptkit.com/cutpastejava.shtml">Add Comment</a>'
menu2[1]='<a href="http://www.javascriptkit.com/javaindex.shtml">View Guestbook</a>'

var menu3=new Array()
menu3[0]='<a href="http://www.javascriptkit.com/cutpastejava.shtml">Join Flight Club</a>'
menu3[1]='<a href="http://www.javascriptkit.com/javaindex.shtml">Pilot Login</a>'
menu3[2]='<a href="http://www.javascriptkit.com/javaindex.shtml">ATC Login</a>'
menu3[3]='<a href="http://www.javascriptkit.com/javaindex.shtml">Route Table</a>'
menu3[4]='<a href="http://www.javascriptkit.com/javaindex.shtml">Route Planner</a>'
menu3[5]='<a href="http://www.javascriptkit.com/javaindex.shtml">Fleet</a>'
menu3[6]='<a href="http://www.javascriptkit.com/javaindex.shtml">Rank System</a>'
menu3[7]='<a href="http://www.javascriptkit.com/javaindex.shtml">Request Training</a>'

var menu4=new Array()
menu4[0]='<a href="http://www.javascriptkit.com">Movies</a>'
menu4[1]='<a href="http://www.javascriptkit.com">Webcams</a>'
menu4[2]='<a href="http://www.javascriptkit.com">Live ATC</a>'
menu4[3]='<a href="http://www.javascriptkit.com">Wallpapers</a>'
menu4[4]='<a href="http://www.javascriptkit.com">Reviews</a>'

var menu5=new Array()
menu5[0]='<a href="http://www.javascriptkit.com">Forums</a>'

var menu6=new Array()
menu6[0]='<a href="http://www.javascriptkit.com">Contact</a>'
menu6[1]='<a href="http://www.javascriptkit.com">Submit News</a>'

var menu7=new Array()
menu7[0]='<a href="http://www.javascriptkit.com">Flightsim</a>'
menu7[1]='<a href="http://www.javascriptkit.com">Real Aviation</a>'
menu7[2]='<a href="http://www.javascriptkit.com">Virtual Airlines</a>'
menu7[3]='<a href="http://www.javascriptkit.com">Freeware Add-on Developers</a>'
menu7[4]='<a href="http://www.javascriptkit.com">Payware Add-on Developers</a>'
menu7[5]='<a href="http://www.javascriptkit.com">Link to Us</a>'

var menu8=new Array()
menu8[0]='<a href="http://www.javascriptkit.com">Flight Simulator History</a>'
menu8[1]='<a href="http://www.javascriptkit.com">Frequently used Words</a>'
menu8[2]='<a href="http://www.javascriptkit.com">Divirse Tutorials</a>'

var menu9=new Array()
menu9[0]='<a href="http://www.javascriptkit.com">Graphic Design</a>'
menu9[1]='<a href="http://www.javascriptkit.com">Web Design</a>'
menu9[2]='<a href="http://www.javascriptkit.com">Other</a>'



var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed
var ie4=document.all
var ns6=document.getElementById&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width: 160px" onmouseover="clearhidemenu()" onmouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}
function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}
return clickreturnvalue()
}
function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}
function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}
function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
</script>

<script language="JavaScript">
function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinute s(),tN().getUTCSeconds()); x.setTime(x.getTime()); return x; }
function tN(){ return new Date(); }
function lZ(x){ return (x>9)?x:'0'+x; }
function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; }
function dT(){ if(fr==0){ fr=1; document.write('<font size="2" face="tahoma" color="#D6D5D5"><b><span id="tP">'+eval(oT)+'</span></b></font>'); } document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); }
var mN=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'),fr=0,oT="tS().getDate()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())+' '+'Z'+'u'+'l'+'u'";
</script>
<script language="JavaScript">dT();</script>

BWiz
07-04-2007, 09:26 PM
Sorry about the late response. In your javascript.js file, you have <script> tags in it. You don't need those, remove them.

CaptainB
07-04-2007, 10:10 PM
No difference with em' removed..

koyama
07-05-2007, 12:24 AM
Hmm... When I go to the live page I find this:


<script type="text/javascript" src="test/javascripts.js"></script>

But it needs to read like this:


<script type="text/javascript" src="javascripts.js"></script>

BWiz
07-05-2007, 12:33 AM
Hmm, i didn't see that. That's probably the answer to the problem.

CaptainB
07-05-2007, 11:46 AM
When will I ever learn...I had uploaded it to a wrong server, as I have 2 servers active...damn. Sorry and thanks for your great help - now it works! :thumbsup:

But I still have a problem with: this (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fmain-layout.php&charset=%28detect+automatically%29&doctype=Inline). How can I correct it?

Also, it says that some of my CSS is invalid: Here (http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fteststyle.css)

abduraooft
07-05-2007, 12:54 PM
When will I ever learn...I had uploaded it to a wrong server, as I have 2 servers active...damn. Sorry and thanks for your great help - now it works! :thumbsup:

But I still have a problem with: this (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fmain-layout.php&charset=%28detect+automatically%29&doctype=Inline). How can I correct it?


Hey..
Its clear from the explanation of error.
If you want to call more than one item in mouseover event, use something like


onmouseover="dropdownmenu(this, event, menu1, '165px');delayhidemenu();"

I guess, in your case it should be one in mouseover and the other in mouseout

onmouseover="dropdownmenu(this, event, menu1, '165px');" onmouseout="delayhidemenu();"

regards,
art.

CaptainB
07-05-2007, 01:01 PM
If I do that, the drop-out menu will dissapear as fast as it came = nobody can use it, as it just drops-in again within 0.5 sec. So that isn't the solution I guess..

abduraooft
07-05-2007, 02:19 PM
If I do that, the drop-out menu will dissapear as fast as it came = nobody can use it, as it just drops-in again within 0.5 sec. So that isn't the solution I guess..

Why it happens so?

The function to display the menu is supposed to be called in 'onmouseover' and to hide is in 'onmouseout'

If then the menu will be there untill you move mouse from there...

CaptainB
07-05-2007, 03:05 PM
Yes! Thank you! It worked :)

Now I just need to get rid of this: THIS (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fmain-layout.php) Why dosn't it allow a "form" element there? Can't I have a name of "form1" or what's the problem?

And this: THIS (http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fteststyle.css). It's just some opacity settings, and they work. So what's wrong with em?

abduraooft
07-05-2007, 03:58 PM
Yes! Thank you! It worked :)

Now I just need to get rid of this: THIS (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.xflightx.port10.com%2Ftest%2Fmain-layout.php) Why dosn't it allow a "form" element there? Can't I have a name of "form1" or what's the problem?



Change your form as

<form action="main-layout.php" method="post" name="form1">
<div>
................all elements go here .................
</div>
</form>

Then, there seems to be some nesting problems with your h2 tag.

CaptainB
07-05-2007, 04:09 PM
That dosn't solve anything, and I think it's because I do something wrong.

Here's the whole form:


if ($votingstep==1) {
write2log("Enters Poll");
setcookie("votingstep","2",time()+$time_between_votes);
$mainstr=$message1;
$step1str='<form action="'.$callingfile.'" method="post" name="form1">';
$totalvotes=SumArray($itemvoted);
$in=0;
$datop=count($item);
while($in<$datop){
$step1str=$step1str.'<input type="radio" name="radios" value="'.$in.'"/> '.stripslashes($item[$in]).'<br/>';
$in++;
}
$step1str=$step1str.'<br/><input style="'.$buttonstyle.'" type="submit" value="'.$vote_str.'"/></form>';
}


Then, if I inset a div here:
$step1str='<form action="'.$callingfile.'" method="post" name="form1">'; <div>

and here:
type="submit" value="'.$vote_str.'"/> </div> </form>';
}

it dosn't change anything. But as I said, I'm sure I'm doing it wrong?

abduraooft
07-05-2007, 05:25 PM
But as I said, I'm sure I'm doing it wrong?


I'm helpless unless you rectify the peoblems in your nested tags around your form

If you change it as


<div id="paddingdiv1"><h2>Do you like the new web?<br /></h2>
<form action="main-layout.php" method="post" name="form1">
<div>
<input type="radio" name="radios" value="0"/>
Yes, it's great!<br/>
<input type="radio" name="radios" value="1"/>
The old was better..<br/>
<input type="radio" name="radios" value="2"/>
I don't care about the design.<br/><br/>
<input style="" type="submit" value="Vote"/>
</div>
</form>Total votes: 3
</div>
it'll validate.

If you want wrap your texts in you form with h2 tag, you have to use seperate h2 tags for each.

Jutlander
07-05-2007, 05:46 PM
If you want wrap your texts in you form with h2 tag, you have to use seperate h2 tags for each.

The most semantic would be to wrap the text in the <label> element.

CaptainB
07-06-2007, 03:10 PM
@ abduraooft:

But I don't have the code as you lay it out there. My code looks like this:


if ($votingstep==1) {
write2log("Enters Poll");
setcookie("votingstep","2",time()+$time_between_votes);
$mainstr=$message1;
$step1str='<form action="'.$callingfile.'" method="post" name="form1">';
$totalvotes=SumArray($itemvoted);
$in=0;
$datop=count($item);
while($in<$datop){
$step1str=$step1str.'<input type="radio" name="radios" value="'.$in.'"/> '.stripslashes($item[$in]).'<br/>';
$in++;
}
$step1str=$step1str.'<br/><input style="'.$buttonstyle.'" type="submit" value="'.$vote_str.'"/></form>';
}

and this is what I have in my .php file:


<div id="box_poll"><h1>Poll</h1>
<div id="paddingdiv1"><h2><?php echo($question); ?>
<br />
<?php if($votingstep==1) { echo($step1str); }
if($votingstep==2) { echo($step2str); }
if($votingstep==3) { echo($step3str); }?>
Total votes: <?php echo($totalvotes); ?></h2></div>
</div>
But it seems like it's the first piece of code there is a problem with, as I don't have a line 281 in my .php file..
So I'm wandering where in that piece of code I should put the divs?

abduraooft
07-06-2007, 03:58 PM
But I don't have the code as you lay it out there. My code looks like this:


Hey CaptainB,

I'm talking about the html source of your page for which you've given link.
Indeed,the validator is also saying about your final html page source, not on your actual code.

All that you have to do is adjust your PHP code (since its generating your html part) which corresponds to the area I mentioned.

CaptainB
07-06-2007, 04:07 PM
Yup...But what should I edit in it? Sorry, I'm really newbie when it comes to php.. :o



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum