hielo 65 Veteran Poster

I can't say which one is "better" than the other. My suggestion to you would be to use whichever of the two you find easier to understand. Down the road you may need to come back to your script and make changes. Understanding well what your code does will make your job easier.

hielo 65 Veteran Poster

a. your javascript code is checking the display property, but your css uses the visibility property.

b. If your css initially has a STYLE block/tag with #submitButton{display:none} (or declared on an exteral stylesheet), then doing alert( document.getElementById('submitButton').style.display ) will reveal that the alerted value will NOT be "none" as declared in the css STYLE tag/external stylesheet. The "XXX.style.display" would show "none" only if you declared it on the tag using the style attribute - ex:

<input style="display:none" />

I suggest you try the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style>	   
#submitButton {
    display:none;
}
</style>
<script>
function showSubmit(){
                var s = document.getElementById("submitButton");
                if (s.style.display!="inline"){
                    s.style.display="inline";
                }
            }
</script>
</head>
<body>
		  
Click <a href="#" onclick="showSubmit()">here</a> to display submit button.
        <form action="mailscript.php" method="post" class="mailbox">
            <table class="mailbox">
            <tr><td>Email To:</td><td><input type="text" name="emailto" /></td></tr>
            <br />
            <tr><td>Subject:</td><td><input type="text" name="subject" /></td></tr>
            <br />
            <tr><td>Message:</td><td><input type="text" name="body" class="body"/></td></tr>
            </table>
            <br />
            <input id="submitButton" type="submit" value="Send Email" class="submit" name="submit"/>
        </form>		  
	   

</body>
</html>
hielo 65 Veteran Poster

, I've ommitted the bits which are not relevent to this problem.

Does the omitted code have the <div class="marker"> ? What you posted does not make sense given $("div.marker").attr("id","marker" + count); since no where on your code do see a div the class="marker" which seems to be the cornerstone of your code!

hielo 65 Veteran Poster

Hope this was what you meant.

No, that wasn't what I meant. You just needed to change line 9 of your original post to what I gave you. Everything else would be the same.

hielo 65 Veteran Poster
$query = "SELECT lastname, firstname, state, zip, jobtype, otherjobtype, nightavail, weekendavail, ptft, resume FROM data 
				WHERE (job_id LIKE '%" . $trimmed . "%') OR (jobtype LIKE '%" . $trimmed . "%')
 ORDER BY lastname ";
hielo 65 Veteran Poster

It's hard to help you without seeing the relevant HTML markup associated with your jquery statements, but I can tell you that

$("#div.marker")

looks "suspicious". That implies that you have some element with id="div" and a class="marker" - for example:

<div id="div" class="marker">...</div>

If the div in question does NOT have id="div" , then get rid of the leading "#" symbol.

hielo 65 Veteran Poster
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
<TITLE>eSales Center - Customer Links</TITLE>
<META HTTP-EQUIV="Cache-Control" CONTENT="No-Cache">
<META HTTP-EQUIV="Pragma" CONTENT="No-Cache">
<META HTTP-EQUIV="Expires" CONTENT="0">


<SCRIPT LANGUAGE="SpeedScript">

{shared/esalesvars.i}
{shared/validate-session.i}
{shared/pp-global.i}

assign cLogin = if trim(cLogin) = "" then get-value("operinit") else cLogin.

</SCRIPT>
</HEAD>
<BODY>
<SCRIPT type="text/javascript">

switch (cLogin)
{
	case "12102":
		document.write('<a href="/WI_testweb/12102.xls"><b><font size="3">Matrix</font></b></a><br />');
		break;

	case "134965":
		document.write('<a href="/WI_testweb/12102.xls"><b><font size="3">Matrix</font></b></a><br />');
		break;

	case "13953":
		document.write('<a href="/WI_testweb/12102.xls"><b><font size="3">Matrix</font></b></a><br />');
		break;

	case "13716":
		document.write('<a href="/WI_testweb/13716.xls"><b><font size="3">Matrix</font></b></a><br />');
		break;

	case "111667":
		document.write('<a href="/WI_testweb/111677.xls"><b><font size="3">Matrix</font></b></a><br />');
		break;

	default:
		window.alert("This account does not have a custom matrix");
}
</SCRIPT>
</BODY>
</HTML>
hielo 65 Veteran Poster

instead of CURLOPT_USERAGENT => "spider", // who am i try proving a value that identifies a popular browser. For example, try this instead: CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0', // who am i

hielo 65 Veteran Poster

Just add an hour, literally:

echo ' ' .date('M. d,Y @ g:i A', strtotime( $row['Timestamp'].' +1 hour') );
hielo 65 Veteran Poster

That could work, but the problem becomes if you want to do anything with CSS. For instance, if you wanted to alternate background colors for even and odd-numbered <div>'s,

Not a problem. Add a common class the elements in question - say "group1":

$("div.group1:even").css("background-color","khaki")
$("div.group1:odd").css("background-color","lightblue")
hielo 65 Veteran Poster

try:

header("refresh: 1; url=" . $_SERVER['PHP_SELF']);
echo substr(time(),-2,2);

http://www.desilva.biz/php/phprefresh.html

hielo 65 Veteran Poster

DATABASE Last Updated On

If you are referring to the playerdb TABLE, then you will need to execute another query just to get that value:
$result=mysql_query("SELECT MAX(`lastUpdate`) as `lastUpdate` FROM `playerdb`") or die(mysql_error());

$row=mysql_fetch_assoc($result);
echo 'Page Last updated on: ' . date('m/d/Y',strtotime($row));

hielo 65 Veteran Poster

make sure your FORM tag is as shown below and get rid of the name attribute in the option tags

<form id="form1" action="" method="post">
<p>Gender: <br>
    <select name="gender">
      <option selected="selected" value="">Choose....</option>
      <option value="male">Male</option>
      <option value="female">Female</option>
    </select>

<% 
if request.form ("gender") = "male" then
%>
<input type="submit" value="Submit" name="btnSubmit" onClick="document.form1.action='send_it.asp';return true;">
<%
else
%>
<input type="submit" value="Submit" name="btnSubmit" onClick="document.form1.action='send_it_female.asp';return true;">
<%
end if
%>
</form>
hielo 65 Veteran Poster

Curl is used for http requests. Based on the sample port you posted, you are probably wanting to connect to an FTP server (Port 21). If so, refer to the FTP functions in php:
http://www.php.net/manual/en/function.ftp-connect.php

IF you are in fact running an HTTP server, then on the following link:
http://blog.unitedheroes.net/curl/

the third example under the "What to do" section shows you how to use curl.

An alternative to curl would be:
file_get_contents();
http://us.php.net/manual/en/function.file-get-contents.php

So if you know the image url, try:

$opts = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept-language: en\r\n" .
              "Cookie: foo=bar\r\n"
  )
);

$context = stream_context_create($opts);

file_put_contents( $_SERVER['DOCUMENT_ROOT'].'/theRemoteImage.gif', file_get_contents('http://remotesite.com/image.gif'), 0, $context);
hielo 65 Veteran Poster

instead of: var request = new Ajax.Request('basket.php', ... try: var request = new Ajax.Request('basket.php?cb='+ (new Date()).valueOf(), ...

hielo 65 Veteran Poster
hielo 65 Veteran Poster

if you are referring to the alignment, try:

document.getElementById('basketerror').innerHTML = "<div>That item is already in your basket.</div>";
hielo 65 Veteran Poster

Thanks Heilo....

It's Hielo

Hoping you aren't a Packers fan though!

No I'm not :)

All I am getting is 0000-00-00 00:00:00

Like I said, if you already had existing records, those records will NOT reflect the timestamp of the date/time when they were originally inserted because mysql doesn't keep track of this. This responsibility falls on the developer.

If you insert new records on that table, then it should automatically include the date and time.

hielo 65 Veteran Poster
function idade(object, birthDay){
	var now = new Date();
	bD = birthDay.value.split('/');
	if(bD.length==3){
		var born = new Date(bD[2], bD[1]*1-1, bD[0]);
		var age=now.getFullYear() - born.getFullYear();
		var yearBD = new Date(now.getFullYear(), bD[1]*1-1, bD[0]);
		if( now.valueOf() < yearBD.valueOf()  )
			--age;
		document.getElementById("computedAge").value = age;
	}
}
hielo 65 Veteran Poster

You are welcome. Please be sure to mark the thread as solved.

Regards,
Hielo

hielo 65 Veteran Poster

My apologies for the oversight. In my original code, I forgot to add ".value" at the end of the statements that retrieve the Month, Day, and Year. It should have been:

var Day=document.getElementById('daysOfMonth').value;
var Month=document.getElementById('monthOfYear').value;
var Year=document.getElementById('year').value;
hielo 65 Veteran Poster

Do you have url to your page? Most likely the issue is in basket.php

hielo 65 Veteran Poster

it should be: var submit = document.getElementsByName("submit")[0]; getElementsByName() returns a collection/array, NOT a single element. My suggestion would be to give your button an id="submitButton" and then use this instead:

var submit = document.getElementById("submitButton");

since IDs are supposed to be unique throughout the page, then you don't need that suffix [X] because document.getElementById returns a single element, not a collection/array.

hielo 65 Veteran Poster
<!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>teste</title>
<script>
function idade(object, birthDay){
	var now = new Date();
	bD = birthDay.value.split('/');
	if(bD.length==3){
		var born = new Date(bD[2], bD[1]*1-1, bD[0]);
		document.getElementById("computedAge").value = ( now.getFullYear() - born.getFullYear() )
	}
}
</script>
</head>


<body>
<form action="" method="post" name="form">
	<table summary="" style="width:10%">
		<tbody>
			<tr>
				<td>
					<input name="datanascimento" type="text" style="display:block;width:100%" onchange="idade(this.form, this);"/>
					<input id="computedAge" name="AGE" type="text" style="display:block;width:100%" readonly="readonly">
				</td>
			</tr>
		</tbody>
	</table>
</form>
</body>
</html>
hielo 65 Veteran Poster

You need to make sub-arrays:
'OldValidFrom'=> array("25/08/2010","26/08/2010","27/08/2010"),

'OldValidTo'=> array("26/08/2110","26/08/2110","27/08/2110"),

hielo 65 Veteran Poster

Try making the following changes:

...
var Day=document.getElementById('daysOfMonth');
var Month=document.getElementById('monthOfYear');
var Year=document.getElementById('year');

var str = Month + " " + Day + " " + Year;
alert(str);
var selectedDate= new Date(str);
...

I was expecting str to be SIMILAR to:
August 28 2010

What does the code above alert() for you?

hielo 65 Veteran Poster

i see you are from Illinois.

If you know what a proxy server is, you wouldn't believe everything you see on the internet :)

Are you a fellow BEARS fan?

Not a chance!

do you know how to output the date and time of the last Database entry/modification

That is not something "automatic". In other words, in MySQL there isn't a "hidden" property/field that would give you this information. YOU (the developer) would need to actually create a TIMESTAMP field.

Things to note:
a. After you insert the field, it is NOT "retroactive". In other words, existing records will not be updated with the actual timestamp of when they were actually inserted/updated in the table. In other words, the records affected would be the new/future records you insert into the table.

b. You can only have ONE TIMESTAMP field per table. You can have other DATETIME fields, but on those fields you need to actually record the date/time your self.

In your case, since the table already exists, you need to use the ALTER TABLE statement. IF you execute the sql statement below, it should insert a timestamp field named `lastUpdate` immediately AFTER the field named `CFHL_B`

ALTER TABLE `playerdb` ADD `lastUpdate` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `CFHL_B`
hielo 65 Veteran Poster

OK, I read your follow-up problems again and I believe I have a clear understanding of your problem. Try:

<?php
error_reporting (E_ERROR);
$query="	SELECT	`Pos`
				,`Last`
				,`First`
				,`CFHL_A` AS `CFHL`
				, `Team`
				,`BDay`
				,`GP0910`
				,`PTS0910` 
			FROM `playerdb` 
			WHERE `CFHL_A`='FREE' 
				AND `Pos`='D' 
	UNION ALL 
		SELECT	`Pos`
				,`Last`
				,`First`
				,`CFHL_B` AS `CFHL`
				, `Team`
				,`BDay`
				,`GP0910`
				,`PTS0910` 
			FROM `playerdb` 
			WHERE `CFHL_B`='FREE' 
				AND `Pos`='D' 
	ORDER BY `PTS0910` DESC, `GP0910` ASC, `Team` ASC";

$result = mysql_query($query) or die("<hr/>Problems executing:<br/>$query<br/>" . mysql_error() );  

echo "<table width='350' border='1' cellspacing='0' cellpadding='1' bgcolor='ffffff'>";
echo "<tr> 
<td width='15' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>#</b></td>
<td width='20' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>POS</b></td>
<td width='170' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>PLAYER</b></td>
<td width='10' bgcolor='000000' align='center'><font face='arial' size='1' color='000000'><b>.</b></td>
<td width='30' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>TEAM</b></td>
<td width='20' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>AGE</b></td>
<td width='20' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>GP</b></td>
<td width='20' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>PTS</b></td>
<td width='30' bgcolor='000000' align='center'><font face='arial' size='1' color='ffffff'><b>PPG</b></td>
</tr>";
// keeps getting the next row until there are no more to get

$n=1;
while($row = mysql_fetch_assoc( $result )) {

	// Print out the contents of each row into a table
	
	
	echo "<tr><td width='20' bgcolor='ffffff' align='center'><font face='arial' size='2' color='000000'>"; 
 	
 	echo "".$n++;
	echo "</td><td width='15' bgcolor='ffffff' align='center'><font face='arial' size='2' color='000000'>";
	echo $row['Pos'];
	echo "</td><td width='170' bgcolor='ffffff' align='left'><font face='arial' size='2' color='000000'>"; 
	echo $row['Last'];
	echo ", ";
	echo $row['First'];
	echo "</td><td width='10' bgcolor='ffffff' align='center'><font face='arial' size='1' color='000000'>";  

 	echo $row['CFHL'];

	echo "</td><td width='30' bgcolor='ffffff' align='center'><font face='arial' size='2' color='000000'>";  
	echo $row['Team'];
	echo "</td><td width='20' bgcolor='ffffff' align='center'><font face='arial' size='2' color='000000'>";   
	echo calculateAge($row['BDay']);
	echo "</td><td width='20' …
ceeandcee commented: Great help! thanks so much! +1
hielo 65 Veteran Poster

then just get rid of the last part where you are appending the time: $dd = substr($d_var['weekday'],0,3) .','. $d_var[mday] .' '.substr($d_var[month],0,3).' '. $d_var[year];

hielo 65 Veteran Poster

So with the first query you should see:
D John Smith A B
D Sally Jones A B
D Jack Brown A

hielo 65 Veteran Poster

In that case use the first query ( the one I left commented out ) and leave everything else the same.

hielo 65 Veteran Poster

What I am saying is that if your table looks as follows:

id...First...Last.....CFHL_A...CFHL_B..Pos
=========================================
1....John....Smith....FREE.....NULL....D
2....John....Smith....NULL.....FREE....D
3....Sally...Jones....FREE.....FREE....D
4....Jack....Brown....FREE.....NULL....D

You should see the records with id = 1, 2, and 4. (Ignore the dots above. I incorporated them just to force alignment of the columns)

hielo 65 Veteran Poster
function getIndex(element)
{
	if( typeof(element.sourceIndex)=="undefined" )
	{
 		for (var i=0; i<document.thisForm.elements.length; i++)
		{
			document.thisForm.elements[i].sourceIndex=i;
		}
	}
return typeof(element.sourceIndex)!="undefined" ? element.sourceIndex : -1;
}
hielo 65 Veteran Poster

Try the code below. Be sure to read comments in the code:

<?php
error_reporting (E_ERROR);

//this should give you all the records where either `CFHL_A`="FREE" or `CFHL_B`="FREE (including the case where BOTH = "FREE"
//$query="SELECT * FROM `playerdb` WHERE (UCASE(TRIM(`CFHL_A`)) = 'FREE' OR UCASE(TRIM(`CFHL_B`)) = 'FREE') AND `Pos`= 'D' ORDER BY `PTS0910` DESC, `GP0910` ASC, `TEAM` ASC";

//this should give you all the records where you only have CFHL_A=="FREE" or CFHL_B==FREE, but not both
$query="SELECT * FROM `playerdb` WHERE (UCASE(TRIM(`CFHL_A`)) = 'FREE' OR UCASE(TRIM(`CFHL_B`)) = 'FREE') AND (UCASE(TRIM(`CFHL_A`))!=UCASE(TRIM(`CFHL_B`))) AND `Pos`= 'D' ORDER BY `PTS0910` DESC, `GP0910` ASC, `TEAM` ASC";
$result = mysql_query($query) or die("<hr/>Problems executing:<br/>$query<br/>" . mysql_error() );  

echo '<table width="350" border="1" cellspacing="0" cellpadding="1" bgcolor="ffffff">
<tr> 
<td width="15" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>#</b></td>
<td width="20" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>POS</b></td>
<td width="170" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>PLAYER</b></td>
<td width="10" bgcolor="000000" align="center"><font face="arial" size="1" color="000000"><b>.</b></td>
<td width="30" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>TEAM</b></td>
<td width="20" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>AGE</b></td>
<td width="20" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>GP</b></td>
<td width="20" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>PTS</b></td>
<td width="30" bgcolor="000000" align="center"><font face="arial" size="1" color="ffffff"><b>PPG</b></td>
</tr>';
// keeps getting the next row until there are no more to get

$n=1;
while($row = mysql_fetch_assoc( $result )) {

	// Print out the contents of each row into a table
	
	
	echo '<tr><td width="20" bgcolor="ffffff" align="center"><font face="arial" size="2" color="000000">' . $n++ .'</td>'; 
	echo '<td width="15" bgcolor="ffffff" align="center"><font face="arial" size="2" color="000000">' . $row['Pos'] .'</td>';
	echo '<td width="170" bgcolor="ffffff" align="left"><font face="arial" size="2" color="000000">' . $row['Last'].', ' . $row['First'] . '</td>';
	echo "<td …
hielo 65 Veteran Poster

better yet, why not make it document.thisForm.elements[i].sourceIndex = i; so that it is "cross-browser compatible". That way in your getIndex() function you can still keep

if( typeof(element.sourceIndex)!="undefined" )
return element.sourceIndex;

as I suggested earlier. That way if you are using IE it will NEVER have to iterate, but if you are using some other browser will iterate at most once!

hielo 65 Veteran Poster

In javascript you cannot customize the buttons.
alert() displays: OK
confirm() and prompt() displays: OK , Cancel

Your option would be to use a javascript plugin:
http://trentrichardson.com/Impromptu/index.php

hielo 65 Veteran Poster

When you execute Select Acc_id FROM ... then your RESULT set should have a "field" named Acc_id. So: rs.Fields("Acc_id") should give you the value of Acc_id in the db table.

However, if you are executing Select Max(Acc_id) FROM ... then your RESULT will NOT have a field name "Acc_id". So this will give you an error: rs.Fields("Acc_id") What you need to do is give your Max() an "alias": Select Max(Acc_id) as Acc_id FROM ...

hielo 65 Veteran Poster

try:

<body>

<?php 

$date = time();

$day = date('d', $date); 
$month = date('m', $date); 
$year = date('Y', $date);

$days_in_month = cal_days_in_month(0, $month, $year);

$current_month = date('F');
//echo $current_month;


?>
<script type="text/javascript">

function isValidDate()
{
	var now = new Date();
	
	//advance one day
	now.setDate( now.getDate() + 1 );

	var Day=document.getElementById('daysOfMonth');
	var Month=document.getElementById('monthOfYear');
	var Year=document.getElementById('year');

	var selectedDate= new Date(Month + " " + Day + " " + Year);
	if(now < selectedDate)
	{
		alert("You may select only future dates");
	}
}
</script>

<form action="recive.php" method="post" name="CheckAvailability" target="_self" id="CheckAvailability">
    <table width="50%" border="0" cellpadding="6" align="center">
      <tr>
        <td><label for="daysOfMonth"></label>
          <div align="right">
            <select name="daysOfMonth" id="daysOfMonth" onchange="isValidDate()">
              <option><?php echo $day + 1; ?></option>
              <?php 
				for($i = 1; $i <= $days_in_month; $i++)
				{
					echo "<option value=".$i.">".$i."</option>";
				}
			?>
            </select>
          </div></td>
        <td><label for="monthOfYear"></label>
          <div align="center">
            <select name="monthOfYear" id="monthOfYear" onchange="isValidDate()">
              <option selected="selected"><?php echo $current_month; ?></option>
              <option value="January">January</option>
              <option value="February">February</option>
              <option value="March">March</option>
              <option value="April">April</option>
              <option value="May">May</option>
              <option value="June">June</option>
              <option value="July">July</option>
              <option value="August">August</option>
              <option value="September">September</option>
              <option value="October">October</option>
              <option value="November">November</option>
              <option value="December">December</option>
            </select>
          </div></td>
        <td><label for="year"></label>
          <select name="year" id="year" onchange="isValidDate()">
            <option selected="selected"><?php echo $year; ?></option>
            <option value="<?php echo $year + 1 ?>"><?php echo $year + 1 ?></option>
            <option value="<?php echo $year + 2 ?>"><?php echo $year + 2 ?></option>
          </select></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><label for="nights">
          <div align="right">Number of nights:</div>
        </label></td>
        <td><select name="nights" id="nights">
          <option value="1" selected="selected">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
          <option value="4">4</option>
          <option value="5">5</option>
          <option value="6">6</option>
          <option value="7">7</option>
          <option value="8">8</option>
          <option value="9">9</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
          <option value="13">13</option>
          <option value="14">14</option>
          <option value="15">15</option>
          <option value="16">16</option>
          <option value="17">17</option>
          <option value="18">18</option>
          <option value="19">19</option>
          <option …
hielo 65 Veteran Poster

a more useful statement would be: $result = mysqli_query($dbc, $query) or die('<hr>Unable to execute query:<br> '. $query . '<br />' . mysqli_error($dbc) ); it would let you see what you actually tried to execute as well as a description of the error. If the problem persists, post the error reported.

hielo 65 Veteran Poster

since you are using " or die(...)", you cannot end line 8 with a semicolon. On line 8 of your ORIGINAL post you correctly left out the semicolon.

It may help you understand that statement if you put in a single line: $result = mysqli_query($dbc, $query) or die('Error querying database: ' . mysqli_error($dbc) );

hielo 65 Veteran Poster

you have back-to-back closing parentheses in the middle condition. Essentially you are closing the if prematurely. You need to move one of those parentheses to the end of the statement right BEFORE the echo.

hielo 65 Veteran Poster

Since the code that we use for validation is a highly standardized and system-wide class

I thought so, that's why I suggested that you STILL keep the current functionality that is accepting a number, but instead IMPROVE it (add more features to it).

Other than that, you have no choice but to iterate through the nodes as you are already doing in your original post. Since the sourceIndex is supported only by IE, then I suggest you modify your code so that it iterates ONLY when the browser is NOT IE:

function getIndex(element)
{
  if( typeof(element.sourceIndex)!="undefined" )
   return element.sourceIndex;

  for (var i=0; i<document.thisForm.elements.length; i++)
    if (element == document.thisForm.elements[i])
      return i;

  return -1;
}
hielo 65 Veteran Poster

are you importing the System.xml namespace?

Refer to:
http://www.devx.com/tips/Tip/21168

hielo 65 Veteran Poster

instead of the keyword "and" try using "&&"

hielo 65 Veteran Poster

I need to find it because the JavaScript validation class has a function for validating a single form element, but it requires that the index number of the element in the form be passed in.

That is where I would concentrate my efforts instead. Since it is expecting a number, then I would modify it so that it can accept either a:
a) number - so it keeps working with whatever existing code you have
b) string - so you can pass an id to a specific element and using document.getElementById() you can obtain a reference to that element
c) an object - so that if you already have a node reference stored in some variable you just pass the reference directly.

hielo 65 Veteran Poster

Open firefox and install colorzilla:
https://addons.mozilla.org/en-US/firefox/addon/271/

After you restart your browser you should see a dropper icon on the lower left hand side of the browser. Go the the image url you posted above, click the colorzilla icon and then hover over the image. Once you are over the color you are interested in, click it to "select" it and "disable" colorzilla. Then put your mouse back on the colorzilla icon but this time do a right-click to copy the color you "selected".
top background color: rgb(45, 87, 147)
bottom background color: rgb(72, 126, 198)

hielo 65 Veteran Poster

i had designed a website using width and height in pixels

Not only that, but you also used a SPECIFIC resolution. Basically you need to make a copy of that page and on the new copy, working with the same resolution as before, start changing those px to percentages until your new design (using percentages) is as close as possible as the old one (using pixels). There is no "magic" formula or tool to do the auto conversion for you.

hielo 65 Veteran Poster

save this as test.html and try it:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr">
<head><meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta name="GENERATOR" content="Microsoft SharePoint" />
<meta name="progid" content="SharePoint.WebPartPage.Document" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Expires" content="0" />
<title>
	
	Dashboard

</title>
<script type="text/javascript">
    function toggleFacRow(rowID) {

        var facRow = document.getElementById('facRow_' + rowID);
        var facButton = document.getElementById('facButton_' + rowID);

        if (facRow.style.display != 'block') {
            facRow.style.display = "block";
            facButton.src = "_layouts/images/TPCOL.gif";
        } else {
            facRow.style.display = "none";
            facButton.src = "_layouts/images/TPEXP.gif";
        }

    }


    function toggleVenRow(VenrowID) {

        var VenRow = document.getElementById('VenRow_' + VenrowID);
        var VenButton = document.getElementById('VenButton_' + VenrowID);

        if (VenRow.style.display == 'none') {
            VenRow.style.display = "";
            VenButton.src = "_layouts/images/TPCOL.gif";
        } else {
            VenRow.style.display = "none";
            VenButton.src = "_layouts/images/TPEXP.gif";
        }

    }
</script>
<style type="text/css">
			.mwh-c {
				text-align:center;
				}
			.mwh-h {
				border-bottom:1px solid silver;
				}
</style>
	
</head>
<body>
<table border="0" width="100%" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tableHeader" colspan="2">Project Name</td>
    <td class="tableHeader">&nbsp;</td>
    <td class="tableHeader">&nbsp;</td>
    <td class="tableHeader">&nbsp;</td>
    <td class="tableHeader">&nbsp;</td>
  </tr>
  <tr style="background-color:#f8f8ff">
    <td valign="top">
      <a href="#" onclick="toggleFacRow('mwh1');return false;">
        <img id="facButton_mwh1" src="_layouts/images/tpexp.gif" height="11px" width="11px" style="border:0px" alt="" />
      </a>
    </td>
    <td class="ms-vb">
      <a name="row_mwh1" />Project A</td>
    <td class="ms-vb">&nbsp;</td>
    <td class="ms-vb">&nbsp;</td>
    <td class="ms-vb">&nbsp;</td>
    <td class="ms-vb">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="6" id="facRow_mwh1" style="display:none;">
      <table style="border:1px solid silver;" cellspacing="0" border="1" width="100%">
        <tr>
          <td class="ms-vb" colspan="2">Vendor</td>
          <td class="ms-vb">&nbsp;</td>
          <td class="ms-vb">&nbsp;</td>
          <td class="ms-vb">&nbsp;</td>
          <td class="ms-vb">&nbsp;</td>
        </tr>
        <tr style="background-color:#f8f8ff">
          <td valign="top">
            <a href="#" onclick="toggleVenRow('mwh1');return false;">
              <img id="VenButton_mwh1" src="_layouts/images/tpexp.gif" height="11px" width="11px" style="border:0px" alt="" />
            </a>
          </td>
          <td class="ms-vb">
            <a name="anchorVenRow_mwh1" />Vendor 1</td>
          <td class="ms-vb">&nbsp;</td>
          <td class="ms-vb">&nbsp;</td>
          <td class="ms-vb">&nbsp;</td>
          <td …
hielo 65 Veteran Poster

I am seeing various references to <a href="javascript<b></b>:XXX('Y')"> where XXX is some function name and Y is the functions argument. You need to get rid of those "b" tags. AI suggest you change that to: <a href="#" onclick="XXX('Y'); return false;"> Also, instead of having the default namespace (xmlns="http://www.w3.org/1999xhtml/1999") as an attribute of some of your elements (like script, style, table, etc), declare it once on the HTML tag. All it's children will "inherit" that namespace so you will not need it on the script, style, table (or whatever other tag you are currently putting it in).

hielo 65 Veteran Poster
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>hielo</title>
<style type="text/css">
.col{float:left;}
.lastCol{float:none}

#product_col1{width:30%;}
#product_col2{width:30%;}
#product_col3{width:30%;}
</style>

	</head>
	<body>
		<div id="product_col1" class="col">
     	<!--Contents of column 1-->a
		</div>

		<div id="product_col2" class="col">
     	<!--Contents of column 2-->b
		</div>

		<div id="product_col3" class="col lastCol">
     	<!--Contents of column 3-->c
		</div>
	</body>
</html>