473,396 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

help with recusion in DOM

I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...

I'm using a very abbreviated set of code to show a calendar. The idea is to
simply hide the calendar when it loses focus. I'm displaying the calendar in
a span tag. When that span loses focus, I recurse through its children. If
focus was lost to a child, then I want to keep the calendar visible. I'm
using the element.all to determine children of a given node. The problem is
that changing the months either with the navigation arrows or via the
drop-down, or by changing the year via its drop-down, the menu
disappears...apparently the navigation links and the select's options are
not seen as a descendant of the primary span tag displaying the calendar.

(Sorry for the text-wrapping...and tia for any thoughts)

Here's a snippet of the html using the calendar:

=====================

<input class="value"
name="programExitDate"
maxlength="255"
style="text-align:left; width:150px;"
type="text"
autocomplete="off"
value="<?= $programExitDate ?>"
onblur="formatDate(this);"
>
<img
src="<?= site::$imagesDirectory ?>calendar.gif"
style="cursor:pointer;"
title="Click For Calendar"
onclick="getDate('programExitCalendar', 'programExitDate');"
>
<span id="programExitCalendar" style="display:none;
postition:relative;"></span>
=====================

Here's the javascript being called:

=====================

String.prototype.repeat = function(l){ var s = '', i = 0; while (i++ <
l){ s += this; } return s; }
String.prototype.zf = function(l){ return '0'.repeat(l -
this.length) + this; }
Date.prototype.format = function(f)
{
if (!this.valueOf()){ return this.toString(); }
var date = this;
var days = new Array(
'Sunday' ,
'Monday' ,
'Tuesday' ,
'Wednesday' ,
'Thursday' ,
'Friday' ,
'Saturday'
);
var months = new Array(
'January' ,
'February' ,
'March' ,
'April' ,
'May' ,
'June' ,
'July' ,
'August' ,
'September' ,
'October' ,
'November' ,
'December'
);
return f.replace(
/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi ,
function($1)
{
switch ($1.toLowerCase())
{
case 'yyyy' : return date.getFullYear();
case 'mmmm' : return months[date.getMonth()];
case 'mmm' : return
months[date.getMonth()].substr(0, 3);
case 'mm' : return new String(date.getMonth() +
1).zf(2);
case 'dddd' : return days[date.getDay()];
case 'ddd' : return days[date.getDay()].substr(0,
3);
case 'dd' : return new
String(date.getDate()).zf(2);
case 'hh' : return new String((h = date.getHours()
% 12) ? h : 12).zf(2);
case 'nn' : return new
String(date.getMinutes()).zf(2);
case 'ss' : return new
String(date.getSeconds()).zf(2);
case 'a/p' : return date.getHours() < 12 ? 'AM' :
'PM';
}
}
);
}

function formatDate(input)
{
if (!input) { return false; }
if (!input.value) { return false; }
if (input.value == ''){ return false; }
var val = new String(input.value);
var month = new String('01');
var day = new String('01');
var year = new String('2000');
val = val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$1/$2/$3");
if (!isDate(val))
{
val = input.value;
val = val.replace(/^(\d{4})[^\d]+(\d{1,2})[^\d]+(\d{1,2})$/,
"$2/$3/$1");
}
if (!isDate(val))
{
input.value = '';
return false;
}
month = "0" + val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$1");
day = "0" + val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$2");
year = val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$3");
val = month.substr(month.length - 2, 2) + "/" +
day.substr(day.length - 2, 2) + "/" + year;
input.value = val;
return true;
}

function getDate(parent, target)
{
parent = document.getElementById(parent);
target = document.getElementById(target);
if (!parent){ return false; }
if (!target){ return false; }
var currentDate = isDate(target.value) ? new Date(target.value) : new
Date();
target.value = isDate(target.value) ? target.value : '';
parent.onblur = function()
{
if (isChild(parent,
document.activeElement)){ return; }
parent.style.display = 'none';
parent.innerHTML = '';
};
showCalendar(parent.id, target.name, currentDate.getFullYear(),
currentDate.getMonth());
return false;
}

function isChild(parent, element)
{
if (element == parent){ return true; }
var children = parent.all;
for (var child in children)
{
var node = children[child];
if (element == node){ return true; }
if (node.all)
{
if (isChild(node, element)){ return true; }
}
}
return false;
}
function showCalendar(showIn, returnTo, year, month, day)
{
showIn = document.getElementById(showIn);
returnTo = document.getElementById(returnTo);
if (!showIn){ return false; }
if (!returnTo){ return false; }
showIn.style.position = 'absolute';
showIn.style.display = '';
if (day)
{
showIn.onblur = null;
showIn.style.display = 'none';
showIn.innerHTML = '';
var date = new Date((month + 1) + '/' + day + '/' + year);
returnTo.value = date.format('mm/dd/yyyy');
returnTo.focus();
returnTo.select();
return false;
}
if (showIn.innerHTML)
{
showIn.innerHTML = '';
return;
}
var link = null;
var months = new Array(
'January' ,
'February' ,
'March' ,
'April' ,
'May' ,
'June' ,
'July' ,
'August' ,
'September' ,
'October' ,
'November' ,
'December'
);
var thisDate = new Date();
year = year < 2000 ? 2000 : year;
year = year 2037 ? 2037 : year;
thisDate.setYear(year);
thisDate.setMonth(month);
thisDate.setDate(1);
var days = 32 - new Date(year, month, 32).getDate();
var nextDate = new Date(year, month, days + 1);
var lastDate = new Date(year, month, 0);
lastDate.setDate(1);
var today = new Date();
var todayDay = today.getDate();
var todayMonth = today.getMonth();
var todayYear = today.getFullYear();
var html = '';
html += '<table style="border:1px solid steelblue; margin:2px;
padding:2px; width:225px;">\n';
html += ' <tr>\n';
html += ' <td style="background-color:#FF9900; font-family:arial;
font-size:7.25pt; padding-right:5px; padding-top:2px;
text-align:right;">\n';
html += ' <a\n';
html += ' href=""\n';
html += ' onclick="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', ' + lastDate.getFullYear() + ', ' + lastDate.getMonth()
+ ')"\n';
html += ' title="Previous Month"\n';
html += ' ><img src="/images/arrow.left.gif"
style="border:none;"></a>\n';
html += ' </td>\n';
html += ' <td colspan="5" style="background-color:#FF9900;
padding-top:2px; text-align:center;">\n';
html += ' <select\n';
html += ' style="font-family:arial; font-size:7.25pt;
text-align:center; width:85px;"\n';
html += ' onchange="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', ' + thisDate.getFullYear() + ', this.value)"\n';
html += ' >\n';
for (month in months)
{
var selected = month == thisDate.getMonth() ? 'selected' : '\n';
html += ' <option value="' + month + '" ' + selected + '>' +
months[month] + '</option>\n';
}
html += ' </select>\n';
html += ' <select\n';
html += ' style="font-family:arial; font-size:7.25pt;
text-align:center; width:50px;"\n';
html += ' onchange="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', this.value, ' + thisDate.getMonth() + ')"\n';
html += ' >\n';
for (year = 2000; year < 2038; year++)
{
var selected = year == thisDate.getFullYear() ? 'selected' : '\n';
html += ' <option value="' + year + '" ' + selected + '>' + year +
'</option>\n';
}
html += ' </select>\n';
html += ' </td>\n';
html += ' <td style="background-color:#FF9900; font-size:7.25pt;
padding-left:5px; padding-top:2px; text-align:left;">\n';
html += ' <a\n';
html += ' href=""\n';
html += ' onclick="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', ' + nextDate.getFullYear() + ', ' + nextDate.getMonth()
+ ')"\n';
html += ' title="Next Month"\n';
html += ' ><img src="/images/arrow.right.gif"
style="border:none;"></a>\n';
html += ' </td>\n';
html += ' <tr><td colspan="7" style="background-color:#FF9900;
border-bottom:1px solid lavender; height:2px;"></td></tr>\n';
html += ' <tr>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Sun</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Mon</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Tue</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Wed</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Thu</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Fri</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Sat</td>\n';
html += ' </tr>\n';
html += ' <tr><td colspan="7" style="border-bottom:1px solid lavender;
height:2px;"></td></tr>\n';
html += ' <tr>\n';
month = thisDate.getMonth();
year = thisDate.getFullYear();
var daysLeft = 0;
var weekDay = thisDate.getDay();
if (weekDay 0)
{
html += ' <td colspan="' + weekDay + '"
style="background-color:lavender; font-size:7.25pt;
width:25px;">&nbsp;</td>\n';
}
for (var day = 1; day <= days; day++)
{
for (; weekDay < 7; weekDay++)
{
if (day days)
{
daysLeft++;
continue;
}
if (!weekDay)
{
html += ' </tr>\n';
html += ' <tr>\n';
}
var border = 'none';
var fontWeight = '100';
if (day == todayDay && month == todayMonth && year == todayYear)
{
border = '1px solid #990000';
fontWeight = '600';
}
html += '<td style="border:' + border + 'font-size:7.25pt;
width:20px;">\n';
html += ' <a\n';
html += ' href="' + day + '"\n';
html += ' style="font-weight:' + fontWeight + ';
text-decoration:none;"\n';
html += ' onclick="return showCalendar(\'' + showIn.id + '\',
\'' + returnTo.name + '\', ' + year + ', ' + month + ', ' + day + ')"\n';
html += ' >' + day + '</a>\n';
html += '</td>\n';
day++
}
day--;
weekDay = 0;
}
if (daysLeft 0)
{
html += ' <td colspan="' + daysLeft + '"
style="background-color:lavender; width:25px;">&nbsp;</td>\n';
}
html += ' </tr>\n';
html += '</table>\n';
showIn.innerHTML = html;
showIn.focus();
return false;
}
=====================
Jun 28 '08 #1
29 1753
forgot that the code above also calls isDate...

function isDate(val)
{
if (!val) { return false; }
if (val == ""){ return false; }
var re = new
RegExp(/^(?:\s+)?(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|
(?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(( [AP]M)|(
[ap]m)))|([01]\d|2[0-3])(:[0-5]\d){1,2})?(?:\s+)?$/);
return re.test(val);
}
Jun 28 '08 #2
Barry wrote:
I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...

I'm using a very abbreviated set of code to show a calendar. The idea is to
simply hide the calendar when it loses focus. I'm displaying the calendar in
a span tag. When that span loses focus, I recurse through its children. If
focus was lost to a child, then I want to keep the calendar visible. I'm
using the element.all to determine children of a given node. The problem is
that changing the months either with the navigation arrows or via the
drop-down, or by changing the year via its drop-down, the menu
disappears...apparently the navigation links and the select's options are
not seen as a descendant of the primary span tag displaying the calendar.

(Sorry for the text-wrapping...and tia for any thoughts)
<snip>

Ask in an appropriate newsgroup and you'll get a good answer.

As you said - this isn't a PHP problem, so this is not the appropriate
newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 28 '08 #3

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:LM******************************@comcast.com. ..
Barry wrote:
>I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...

I'm using a very abbreviated set of code to show a calendar. The idea is
to simply hide the calendar when it loses focus. I'm displaying the
calendar in a span tag. When that span loses focus, I recurse through its
children. If focus was lost to a child, then I want to keep the calendar
visible. I'm using the element.all to determine children of a given node.
The problem is that changing the months either with the navigation arrows
or via the drop-down, or by changing the year via its drop-down, the menu
disappears...apparently the navigation links and the select's options are
not seen as a descendant of the primary span tag displaying the calendar.

(Sorry for the text-wrapping...and tia for any thoughts)

<snip>

Ask in an appropriate newsgroup and you'll get a good answer.

As you said - this isn't a PHP problem, so this is not the appropriate
newsgroup.
I know, but getting a reponse - much less a timely one - is a bit
troublesome. As it is, I've figured it out. The problem wasn't recusion for
child nodes, it was 'remnant' code i'd left in while prototyping...where I
was setting the span's innerHTML to ''. It works fine now.

Thanks anyway.
Jun 28 '08 #4
Barry wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:LM******************************@comcast.com. ..
>Barry wrote:
>>I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...

I'm using a very abbreviated set of code to show a calendar. The idea is
to simply hide the calendar when it loses focus. I'm displaying the
calendar in a span tag. When that span loses focus, I recurse through its
children. If focus was lost to a child, then I want to keep the calendar
visible. I'm using the element.all to determine children of a given node.
The problem is that changing the months either with the navigation arrows
or via the drop-down, or by changing the year via its drop-down, the menu
disappears...apparently the navigation links and the select's options are
not seen as a descendant of the primary span tag displaying the calendar.

(Sorry for the text-wrapping...and tia for any thoughts)
<snip>

Ask in an appropriate newsgroup and you'll get a good answer.

As you said - this isn't a PHP problem, so this is not the appropriate
newsgroup.

I know, but getting a reponse - much less a timely one - is a bit
troublesome. As it is, I've figured it out. The problem wasn't recusion for
child nodes, it was 'remnant' code i'd left in while prototyping...where I
was setting the span's innerHTML to ''. It works fine now.

Thanks anyway.

It's a lot less troublesome to get a response when you ask in the
correct newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 28 '08 #5

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:NO******************************@comcast.com. ..
Barry wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:LM******************************@comcast.com ...
>>Barry wrote:
I know this is not a php question. If that bothers you, don't respond.
If not, I sure could use the advice...

I'm using a very abbreviated set of code to show a calendar. The idea
is to simply hide the calendar when it loses focus. I'm displaying the
calendar in a span tag. When that span loses focus, I recurse through
its children. If focus was lost to a child, then I want to keep the
calendar visible. I'm using the element.all to determine children of a
given node. The problem is that changing the months either with the
navigation arrows or via the drop-down, or by changing the year via its
drop-down, the menu disappears...apparently the navigation links and
the select's options are not seen as a descendant of the primary span
tag displaying the calendar.

(Sorry for the text-wrapping...and tia for any thoughts)

<snip>

Ask in an appropriate newsgroup and you'll get a good answer.

As you said - this isn't a PHP problem, so this is not the appropriate
newsgroup.

I know, but getting a reponse - much less a timely one - is a bit
troublesome. As it is, I've figured it out. The problem wasn't recusion
for child nodes, it was 'remnant' code i'd left in while
prototyping...where I was setting the span's innerHTML to ''. It works
fine now.

Thanks anyway.

It's a lot less troublesome to get a response when you ask in the correct
newsgroup
Troublesome is not getting a response at all...*from* the correct newsgroup.
:)
Jun 28 '08 #6
Barry wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:NO******************************@comcast.com. ..
>Barry wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:LM******************************@comcast.co m...
Barry wrote:
I know this is not a php question. If that bothers you, don't respond.
If not, I sure could use the advice...
>
I'm using a very abbreviated set of code to show a calendar. The idea
is to simply hide the calendar when it loses focus. I'm displaying the
calendar in a span tag. When that span loses focus, I recurse through
its children. If focus was lost to a child, then I want to keep the
calendar visible. I'm using the element.all to determine children of a
given node. The problem is that changing the months either with the
navigation arrows or via the drop-down, or by changing the year via its
drop-down, the menu disappears...apparently the navigation links and
the select's options are not seen as a descendant of the primary span
tag displaying the calendar.
>
(Sorry for the text-wrapping...and tia for any thoughts)
>
<snip>

Ask in an appropriate newsgroup and you'll get a good answer.

As you said - this isn't a PHP problem, so this is not the appropriate
newsgroup.
I know, but getting a reponse - much less a timely one - is a bit
troublesome. As it is, I've figured it out. The problem wasn't recusion
for child nodes, it was 'remnant' code i'd left in while
prototyping...where I was setting the span's innerHTML to ''. It works
fine now.

Thanks anyway.
It's a lot less troublesome to get a response when you ask in the correct
newsgroup

Troublesome is not getting a response at all...*from* the correct newsgroup.
:)

So you think you can ask in just any old newsgroup and get an answer?

That's why there are different newsgroup for different purposes -
because here we want to talk about PHP and not put up with all of that
javascript.

When I want javascript help I got to a javascript newsgroup.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 28 '08 #7

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:R9******************************@comcast.com. ..
Barry wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:NO******************************@comcast.com ...
>>Barry wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:LM******************************@comcast.c om...
Barry wrote:
>I know this is not a php question. If that bothers you, don't
>respond. If not, I sure could use the advice...
>>
>I'm using a very abbreviated set of code to show a calendar. The idea
>is to simply hide the calendar when it loses focus. I'm displaying
>the calendar in a span tag. When that span loses focus, I recurse
>through its children. If focus was lost to a child, then I want to
>keep the calendar visible. I'm using the element.all to determine
>children of a given node. The problem is that changing the months
>either with the navigation arrows or via the drop-down, or by
>changing the year via its drop-down, the menu disappears...apparently
>the navigation links and the select's options are not seen as a
>descendant of the primary span tag displaying the calendar.
>>
>(Sorry for the text-wrapping...and tia for any thoughts)
>>
<snip>
>
Ask in an appropriate newsgroup and you'll get a good answer.
>
As you said - this isn't a PHP problem, so this is not the appropriate
newsgroup.
I know, but getting a reponse - much less a timely one - is a bit
troublesome. As it is, I've figured it out. The problem wasn't recusion
for child nodes, it was 'remnant' code i'd left in while
prototyping...where I was setting the span's innerHTML to ''. It works
fine now.

Thanks anyway.
It's a lot less troublesome to get a response when you ask in the
correct newsgroup

Troublesome is not getting a response at all...*from* the correct
newsgroup. :)

So you think you can ask in just any old newsgroup and get an answer?
Uhm, no. I wouldn't ask this question in alt.strawmen. But, since web
developers of all sorts will inevitably use javascript and since I'm using
php, I thought it better to ask in this php ng rather than, say,
alt.lang.asp (but would be just as likely get a correct response there as
well).
That's why there are different newsgroup for different purposes - because
here we want to talk about PHP and not put up with all of that javascript.
Let me clue you in, Jerry...

"I know this is not a php question. If that bothers you, don't respond."

In the first two sentences of my OP, you should have put your blinders on
and gone on to a post you *prefer* to answer...unless, you really prefer to
waste time in such a manner as you've done in replying to this thread. :)

Oh, and by "we want", I think you're only speaking for yourself and a narrow
margin of others..who still may be a bit reluctant to have you as their
spokesperson.
When I want javascript help I got to a javascript newsgroup.
Yep. Me too. But when I don't 'got' a response there, I don't exclude other
alternatives for fear I may get inane flames...as is evidenciarily proving
itself out here, now.

Have a nice day.
Jun 28 '08 #8
..oO(Barry)
>Uhm, no. I wouldn't ask this question in alt.strawmen. But, since web
developers of all sorts will inevitably use javascript
I don't.
>and since I'm using
php, I thought it better to ask in this php ng rather than, say,
alt.lang.asp (but would be just as likely get a correct response there as
well).
The correct newsgroup would be <news:comp.lang.javascript>. Here it is
totally OT.
>That's why there are different newsgroup for different purposes - because
here we want to talk about PHP and not put up with all of that javascript.

Let me clue you in, Jerry...

"I know this is not a php question. If that bothers you, don't respond."

In the first two sentences of my OP, you should have put your blinders on
and gone on to a post you *prefer* to answer...unless, you really prefer to
waste time in such a manner as you've done in replying to this thread. :)
You know that it's OT and still post it? Maybe you should close your OE
for a while and learn something about Usenet and the netiquette first.
>Oh, and by "we want", I think you're only speaking for yourself and a narrow
margin of others..who still may be a bit reluctant to have you as their
spokesperson.
>When I want javascript help I got to a javascript newsgroup.

Yep. Me too. But when I don't 'got' a response there
.... then ask again and rephrase your question.
>I don't exclude other
alternatives for fear I may get inane flames...as is evidenciarily proving
itself out here, now.
What makes you think that you'll get answers to a JS problem in a PHP
group? Would you also ask PHP question over in clj if you don't get an
answer here?

How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html

EOT
Micha
Jun 28 '08 #9
Barry wrote:
I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...
Barry, you should learn something from this.

You've asked an OT question without bothering to ask in the group it
would be on topic for. Then you've wasted a lot of time arguing about
this. Just look at the length of the thread.

BTW, what's with all the inline styles? You could benefit by
learning about CSS descendants, a few classes, and adding a small
stylesheet. And, don't use points.

Jeff

>
I'm using a very abbreviated set of code to show a calendar. The idea is to
simply hide the calendar when it loses focus. I'm displaying the calendar in
a span tag. When that span loses focus, I recurse through its children. If
focus was lost to a child, then I want to keep the calendar visible. I'm
using the element.all to determine children of a given node. The problem is
that changing the months either with the navigation arrows or via the
drop-down, or by changing the year via its drop-down, the menu
disappears...apparently the navigation links and the select's options are
not seen as a descendant of the primary span tag displaying the calendar.

(Sorry for the text-wrapping...and tia for any thoughts)

Here's a snippet of the html using the calendar:

=====================

<input class="value"
name="programExitDate"
maxlength="255"
style="text-align:left; width:150px;"
type="text"
autocomplete="off"
value="<?= $programExitDate ?>"
onblur="formatDate(this);"
<img
src="<?= site::$imagesDirectory ?>calendar.gif"
style="cursor:pointer;"
title="Click For Calendar"
onclick="getDate('programExitCalendar', 'programExitDate');"
<span id="programExitCalendar" style="display:none;
postition:relative;"></span>
=====================

Here's the javascript being called:

=====================

String.prototype.repeat = function(l){ var s = '', i = 0; while (i++ <
l){ s += this; } return s; }
String.prototype.zf = function(l){ return '0'.repeat(l -
this.length) + this; }
Date.prototype.format = function(f)
{
if (!this.valueOf()){ return this.toString(); }
var date = this;
var days = new Array(
'Sunday' ,
'Monday' ,
'Tuesday' ,
'Wednesday' ,
'Thursday' ,
'Friday' ,
'Saturday'
);
var months = new Array(
'January' ,
'February' ,
'March' ,
'April' ,
'May' ,
'June' ,
'July' ,
'August' ,
'September' ,
'October' ,
'November' ,
'December'
);
return f.replace(
/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|a\/p)/gi ,
function($1)
{
switch ($1.toLowerCase())
{
case 'yyyy' : return date.getFullYear();
case 'mmmm' : return months[date.getMonth()];
case 'mmm' : return
months[date.getMonth()].substr(0, 3);
case 'mm' : return new String(date.getMonth() +
1).zf(2);
case 'dddd' : return days[date.getDay()];
case 'ddd' : return days[date.getDay()].substr(0,
3);
case 'dd' : return new
String(date.getDate()).zf(2);
case 'hh' : return new String((h = date.getHours()
% 12) ? h : 12).zf(2);
case 'nn' : return new
String(date.getMinutes()).zf(2);
case 'ss' : return new
String(date.getSeconds()).zf(2);
case 'a/p' : return date.getHours() < 12 ? 'AM' :
'PM';
}
}
);
}

function formatDate(input)
{
if (!input) { return false; }
if (!input.value) { return false; }
if (input.value == ''){ return false; }
var val = new String(input.value);
var month = new String('01');
var day = new String('01');
var year = new String('2000');
val = val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$1/$2/$3");
if (!isDate(val))
{
val = input.value;
val = val.replace(/^(\d{4})[^\d]+(\d{1,2})[^\d]+(\d{1,2})$/,
"$2/$3/$1");
}
if (!isDate(val))
{
input.value = '';
return false;
}
month = "0" + val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$1");
day = "0" + val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$2");
year = val.replace(/^(\d{1,2})[^\d]+(\d{1,2})[^\d]+(\d{4})$/,
"$3");
val = month.substr(month.length - 2, 2) + "/" +
day.substr(day.length - 2, 2) + "/" + year;
input.value = val;
return true;
}

function getDate(parent, target)
{
parent = document.getElementById(parent);
target = document.getElementById(target);
if (!parent){ return false; }
if (!target){ return false; }
var currentDate = isDate(target.value) ? new Date(target.value) : new
Date();
target.value = isDate(target.value) ? target.value : '';
parent.onblur = function()
{
if (isChild(parent,
document.activeElement)){ return; }
parent.style.display = 'none';
parent.innerHTML = '';
};
showCalendar(parent.id, target.name, currentDate.getFullYear(),
currentDate.getMonth());
return false;
}

function isChild(parent, element)
{
if (element == parent){ return true; }
var children = parent.all;
for (var child in children)
{
var node = children[child];
if (element == node){ return true; }
if (node.all)
{
if (isChild(node, element)){ return true; }
}
}
return false;
}
function showCalendar(showIn, returnTo, year, month, day)
{
showIn = document.getElementById(showIn);
returnTo = document.getElementById(returnTo);
if (!showIn){ return false; }
if (!returnTo){ return false; }
showIn.style.position = 'absolute';
showIn.style.display = '';
if (day)
{
showIn.onblur = null;
showIn.style.display = 'none';
showIn.innerHTML = '';
var date = new Date((month + 1) + '/' + day + '/' + year);
returnTo.value = date.format('mm/dd/yyyy');
returnTo.focus();
returnTo.select();
return false;
}
if (showIn.innerHTML)
{
showIn.innerHTML = '';
return;
}
var link = null;
var months = new Array(
'January' ,
'February' ,
'March' ,
'April' ,
'May' ,
'June' ,
'July' ,
'August' ,
'September' ,
'October' ,
'November' ,
'December'
);
var thisDate = new Date();
year = year < 2000 ? 2000 : year;
year = year 2037 ? 2037 : year;
thisDate.setYear(year);
thisDate.setMonth(month);
thisDate.setDate(1);
var days = 32 - new Date(year, month, 32).getDate();
var nextDate = new Date(year, month, days + 1);
var lastDate = new Date(year, month, 0);
lastDate.setDate(1);
var today = new Date();
var todayDay = today.getDate();
var todayMonth = today.getMonth();
var todayYear = today.getFullYear();
var html = '';
html += '<table style="border:1px solid steelblue; margin:2px;
padding:2px; width:225px;">\n';
html += ' <tr>\n';
html += ' <td style="background-color:#FF9900; font-family:arial;
font-size:7.25pt; padding-right:5px; padding-top:2px;
text-align:right;">\n';
html += ' <a\n';
html += ' href=""\n';
html += ' onclick="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', ' + lastDate.getFullYear() + ', ' + lastDate.getMonth()
+ ')"\n';
html += ' title="Previous Month"\n';
html += ' ><img src="/images/arrow.left.gif"
style="border:none;"></a>\n';
html += ' </td>\n';
html += ' <td colspan="5" style="background-color:#FF9900;
padding-top:2px; text-align:center;">\n';
html += ' <select\n';
html += ' style="font-family:arial; font-size:7.25pt;
text-align:center; width:85px;"\n';
html += ' onchange="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', ' + thisDate.getFullYear() + ', this.value)"\n';
html += ' >\n';
for (month in months)
{
var selected = month == thisDate.getMonth() ? 'selected' : '\n';
html += ' <option value="' + month + '" ' + selected + '>' +
months[month] + '</option>\n';
}
html += ' </select>\n';
html += ' <select\n';
html += ' style="font-family:arial; font-size:7.25pt;
text-align:center; width:50px;"\n';
html += ' onchange="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', this.value, ' + thisDate.getMonth() + ')"\n';
html += ' >\n';
for (year = 2000; year < 2038; year++)
{
var selected = year == thisDate.getFullYear() ? 'selected' : '\n';
html += ' <option value="' + year + '" ' + selected + '>' + year +
'</option>\n';
}
html += ' </select>\n';
html += ' </td>\n';
html += ' <td style="background-color:#FF9900; font-size:7.25pt;
padding-left:5px; padding-top:2px; text-align:left;">\n';
html += ' <a\n';
html += ' href=""\n';
html += ' onclick="showCalendar(\'' + showIn.id + '\', \'' +
returnTo.name + '\', ' + nextDate.getFullYear() + ', ' + nextDate.getMonth()
+ ')"\n';
html += ' title="Next Month"\n';
html += ' ><img src="/images/arrow.right.gif"
style="border:none;"></a>\n';
html += ' </td>\n';
html += ' <tr><td colspan="7" style="background-color:#FF9900;
border-bottom:1px solid lavender; height:2px;"></td></tr>\n';
html += ' <tr>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Sun</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Mon</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Tue</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Wed</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Thu</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Fri</td>\n';
html += ' <td style="font-size:7.25pt; font-weight:600;
text-align:center; width:25px;">Sat</td>\n';
html += ' </tr>\n';
html += ' <tr><td colspan="7" style="border-bottom:1px solid lavender;
height:2px;"></td></tr>\n';
html += ' <tr>\n';
month = thisDate.getMonth();
year = thisDate.getFullYear();
var daysLeft = 0;
var weekDay = thisDate.getDay();
if (weekDay 0)
{
html += ' <td colspan="' + weekDay + '"
style="background-color:lavender; font-size:7.25pt;
width:25px;">&nbsp;</td>\n';
}
for (var day = 1; day <= days; day++)
{
for (; weekDay < 7; weekDay++)
{
if (day days)
{
daysLeft++;
continue;
}
if (!weekDay)
{
html += ' </tr>\n';
html += ' <tr>\n';
}
var border = 'none';
var fontWeight = '100';
if (day == todayDay && month == todayMonth && year == todayYear)
{
border = '1px solid #990000';
fontWeight = '600';
}
html += '<td style="border:' + border + 'font-size:7.25pt;
width:20px;">\n';
html += ' <a\n';
html += ' href="' + day + '"\n';
html += ' style="font-weight:' + fontWeight + ';
text-decoration:none;"\n';
html += ' onclick="return showCalendar(\'' + showIn.id + '\',
\'' + returnTo.name + '\', ' + year + ', ' + month + ', ' + day + ')"\n';
html += ' >' + day + '</a>\n';
html += '</td>\n';
day++
}
day--;
weekDay = 0;
}
if (daysLeft 0)
{
html += ' <td colspan="' + daysLeft + '"
style="background-color:lavender; width:25px;">&nbsp;</td>\n';
}
html += ' </tr>\n';
html += '</table>\n';
showIn.innerHTML = html;
showIn.focus();
return false;
}
=====================

Jun 29 '08 #10

"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlink.co m...
Barry wrote:
>I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...

Barry, you should learn something from this.

You've asked an OT question without bothering to ask in the group it would
be on topic for. Then you've wasted a lot of time arguing about this. Just
look at the length of the thread.
hey jeff. i actually did ask the question in two javascript newsgroups.
after not getting any hits, i asked here. as for my time, i appreciate your
consideration thereof.
BTW, what's with all the inline styles? You could benefit by learning
about CSS descendants, a few classes, and adding a small stylesheet. And,
don't use points.
i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.

btw, what's wrong with points?

thanks.
Jun 30 '08 #11
..oO(Barry)
>Grow up, Jerry.
Why do you say the same thing the third time? Why do you quote the
entire posting the third time? Why don't you just leave and ask your
questions in the appropriate newsgroups?

Micha
Jun 30 '08 #12

"Michael Fesser" <ne*****@gmx.dewrote in message
news:cs********************************@4ax.com...
.oO(Barry)
>>Grow up, Jerry.

Why do you say the same thing the third time? Why do you quote the
entire posting the third time? Why don't you just leave and ask your
questions in the appropriate newsgroups?
I'm simply amazed that Jerry still feels the need to respond. Seems he's a
'last word in' kind of guy. Leaving in the entire post just ensures that
other readers know what the comment applies to. As for leaving...nah.

Why is this all such a big deal? You and Jerry are both free to ignore the
thread. As you stated before, I'm using OE...surely someone with a muuuuch
more sophisticated newsreader can figure out how to do that. :)

Cheers.
Jun 30 '08 #13
Barry wrote:
ers again.
>
Grow up, Jerry.
Yep, you need to grow up, Barry. Poor little boy threw a temper tantrum
and now needs his diapers changed!
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 1 '08 #14
Barry wrote:
"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlink.co m...
>Barry wrote:
>>I know this is not a php question. If that bothers you, don't respond. If
not, I sure could use the advice...
Barry, you should learn something from this.

You've asked an OT question without bothering to ask in the group it would
be on topic for. Then you've wasted a lot of time arguing about this. Just
look at the length of the thread.

hey jeff. i actually did ask the question in two javascript newsgroups.
after not getting any hits, i asked here. as for my time, i appreciate your
consideration thereof.
> BTW, what's with all the inline styles? You could benefit by learning
about CSS descendants, a few classes, and adding a small stylesheet. And,
don't use points.

i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.

btw, what's wrong with points?
Historically points are defined by what the OS determines the height of
1" is in pixels. PCs settled on 72, Macs on 90 (I believe). So there's
quite a size discrepancy if you view on a Mac. That can be particularly
bad for small font sizes. Not sure where this issue stands now...

Jeff
>
thanks.

Jul 1 '08 #15

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
Barry wrote:
ers again.
>>
Grow up, Jerry.
Yep, you need to grow up, Barry. Poor little boy threw a temper tantrum
and now needs his diapers changed!
Grow up, Jerry.
Jul 1 '08 #16

"Jeff" <jeff@spam_me_not.comwrote in message
news:rI******************************@earthlink.co m...
Barry wrote:
>"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlink.c om...
>>Barry wrote:
I know this is not a php question. If that bothers you, don't respond.
If not, I sure could use the advice...
Barry, you should learn something from this.

You've asked an OT question without bothering to ask in the group it
would be on topic for. Then you've wasted a lot of time arguing about
this. Just look at the length of the thread.

hey jeff. i actually did ask the question in two javascript newsgroups.
after not getting any hits, i asked here. as for my time, i appreciate
your consideration thereof.
>> BTW, what's with all the inline styles? You could benefit by learning
about CSS descendants, a few classes, and adding a small stylesheet.
And, don't use points.

i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.

btw, what's wrong with points?

Historically points are defined by what the OS determines the height of 1"
is in pixels. PCs settled on 72, Macs on 90 (I believe). So there's quite
a size discrepancy if you view on a Mac. That can be particularly bad for
small font sizes. Not sure where this issue stands now...
Interesting. What do you use? em? My usual alternate is px. Is that a less
varying display among different OS's?
Jul 1 '08 #17
Barry wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
>Barry wrote:
ers again.
>>Grow up, Jerry.
Yep, you need to grow up, Barry. Poor little boy threw a temper tantrum
and now needs his diapers changed!

Grow up, Jerry.
ROFLMAO! Right from the temper tantrum throwing, dirty diapered
toddler's mouth.

Get lost, little boy. You aren't wanted around here.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 1 '08 #18
Jeff wrote:
Barry wrote:
>"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlink.c om...
>>Barry wrote:
I know this is not a php question. If that bothers you, don't
respond. If not, I sure could use the advice...
Barry, you should learn something from this.

You've asked an OT question without bothering to ask in the group it
would be on topic for. Then you've wasted a lot of time arguing about
this. Just look at the length of the thread.

hey jeff. i actually did ask the question in two javascript
newsgroups. after not getting any hits, i asked here. as for my time,
i appreciate your consideration thereof.
>> BTW, what's with all the inline styles? You could benefit by
learning about CSS descendants, a few classes, and adding a small
stylesheet. And, don't use points.

i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.

btw, what's wrong with points?

Historically points are defined by what the OS determines the height of
1" is in pixels. PCs settled on 72, Macs on 90 (I believe). So there's
quite a size discrepancy if you view on a Mac. That can be particularly
bad for small font sizes. Not sure where this issue stands now...

Jeff
>>
thanks.
Jeff,

Please take this to a more appropriate forum. Font sizes are not
related to php. And discussing off-topic subjects just encourages more
of the same - especially with Barry.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 1 '08 #19

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
Barry wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
>>Barry wrote:
ers again.
Grow up, Jerry.
Yep, you need to grow up, Barry. Poor little boy threw a temper tantrum
and now needs his diapers changed!

Grow up, Jerry.

ROFLMAO! Right from the temper tantrum throwing, dirty diapered toddler's
mouth.

Get lost, little boy. You aren't wanted around here.
Grow up, Jerry.
Jul 1 '08 #20

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
Jeff wrote:
>Barry wrote:
>>"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlink. com...
Barry wrote:
I know this is not a php question. If that bothers you, don't respond.
If not, I sure could use the advice...
Barry, you should learn something from this.

You've asked an OT question without bothering to ask in the group it
would be on topic for. Then you've wasted a lot of time arguing about
this. Just look at the length of the thread.

hey jeff. i actually did ask the question in two javascript newsgroups.
after not getting any hits, i asked here. as for my time, i appreciate
your consideration thereof.

BTW, what's with all the inline styles? You could benefit by learning
about CSS descendants, a few classes, and adding a small stylesheet.
And, don't use points.

i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.

btw, what's wrong with points?

Historically points are defined by what the OS determines the height of
1" is in pixels. PCs settled on 72, Macs on 90 (I believe). So there's
quite a size discrepancy if you view on a Mac. That can be particularly
bad for small font sizes. Not sure where this issue stands now...

Jeff
>>>
thanks.

Jeff,

Please take this to a more appropriate forum. Font sizes are not related
to php. And discussing off-topic subjects just encourages more of the
same - especially with Barry.
Font sizes are php related. I use php to get the OS and browser to adjust
font sizes to make them the size I want, uniformly. If using px or em
instead of doing the php detection and using pt, then there is less
programming that has to be done. But, since you're an idiot, I wouldn't
expect you to relate php with anything web-related.
Jul 1 '08 #21
"Barry" <no****@example.composted in comp.lang.php:
>
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
>Jeff wrote:
>>Barry wrote:
"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlink .com...
Barry wrote:
>I know this is not a php question. If that bothers you, don't
>respond. If not, I sure could use the advice...
Barry, you should learn something from this.
>
You've asked an OT question without bothering to ask in the group it
would be on topic for. Then you've wasted a lot of time arguing
about this. Just look at the length of the thread.

hey jeff. i actually did ask the question in two javascript
newsgroups. after not getting any hits, i asked here. as for my time,
i appreciate your consideration thereof.

BTW, what's with all the inline styles? You could benefit by
learning
about CSS descendants, a few classes, and adding a small stylesheet.
And, don't use points.

i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.

btw, what's wrong with points?

Historically points are defined by what the OS determines the height
of 1" is in pixels. PCs settled on 72, Macs on 90 (I believe). So
there's quite a size discrepancy if you view on a Mac. That can be
particularly bad for small font sizes. Not sure where this issue
stands now...

Jeff

thanks.


Jeff,

Please take this to a more appropriate forum. Font sizes are not
related to php. And discussing off-topic subjects just encourages more
of the same - especially with Barry.

Font sizes are php related. I use php to get the OS and browser to
adjust font sizes to make them the size I want, uniformly. If using px
or em instead of doing the php detection and using pt, then there is
less programming that has to be done. But, since you're an idiot, I
wouldn't expect you to relate php with anything web-related.
Good grief. By that logic, everything is PHP related. "I use PHP to get the OS and browser to display my
Web pages about <any topic whatsoever>. How do I get PHP to show white text on a black background?
What image(s) should I use to convey <any topic whatsoever>? What sources should I cite for <any
topic whatsoever>? I'm using PHP, so I expect an answer in here!"

If, for some reason, you feel you must post OT in any newsgroup, the general netiquette is to include OT
in the subject of your message. That way, those of us who are reading this newsgroup and either do not
have time or do not wish to read OT posts can move right past the thread - or filter them completely.
You stand a /slightly/ better chance of getting an answer and the newsgroups you seek help from will be
less diluted with OT - if you can filter the OT.

The basic rule I use is, if I couldn't find it by RTFM, which newsgroup is most likely to point me to the
correct place in the FM - and which FM? You don't really think you're going to learn about JavaScript and
browser fonts in the PHP manual, do you? Have you thought about where you might learn such
information?

I understand that you tried and failed to get your JavaScript question answered in the right groups, but
that typically means that 1) it is a FAQ that regulars are tired of answereing. Use groups.google.com to
see if it's been answered 2) your question may have been worded in a confusing manner. Try re-wording
the question. 3) you may have already offended the regulars and have been plonked. There can be other
reasons, but those are the most common.

I believe that you are already fully aware of all of the above, but have chosen to ignore them anyway,
hence the OT and your insistance that it's OK to post OT. I think you are aware of newsgroup netiquette,
but I don't think you are aware of the reason it exists. It is not so that "netcops" can try to enforce the
"laws of usenet", but more a set of guidelines that help people get faster and more accurate answers to
their questions. If you weren't aware before this thread, you certainly are now since several people have
pointed it out.

Therefore, I believe that you expect to be berated every time you post such OT in this group. Such is an
excellent reason for others to plonk you. You will lose nothing by my plonking since I don't post much in
here yet, but my reading of this group will improve.

Thus ends my one and only OT contribution to this thread - with apologies to the regs.
Jul 1 '08 #22
..oO(Barry)
>Font sizes are php related.
The weather is also PHP-related, because I can use PHP to fetch the
current values and forecast from the next weather station and display it
on my site.
>I use php to get the OS and browser to adjust
font sizes to make them the size I want, uniformly.
Such sniffing is almost always a sure sign of a poor layout or broken
code. And what do the OS and browser have to do with font sizes at all?
>If using px or em
instead of doing the php detection and using pt
Using pt in a stylesheet is even more stupid (the only exception might
be a printer CSS).
>then there is less
programming that has to be done. But, since you're an idiot, I wouldn't
expect you to relate php with anything web-related.
You should learn HTML and CSS and ask in the appropriate authoring
newsgroups how to do things properly without browser sniffing.

Still nothing to do with PHP.

Micha
Jul 1 '08 #23

"Michael Fesser" <ne*****@gmx.dewrote in message
news:44********************************@4ax.com...
.oO(Barry)
>>Font sizes are php related.

The weather is also PHP-related, because I can use PHP to fetch the
current values and forecast from the next weather station and display it
on my site.
And if you had a problem creating the functionality in php to do that, you'd
probably ask it here. Your point isn't very poigniant.
>>I use php to get the OS and browser to adjust
font sizes to make them the size I want, uniformly.

Such sniffing is almost always a sure sign of a poor layout or broken
code. And what do the OS and browser have to do with font sizes at all?
Different OS's render fonts differently, however even on the same OS, you
can still have a varied appearance given the browser being used. You should
know that.
>>If using px or em
instead of doing the php detection and using pt

Using pt in a stylesheet is even more stupid (the only exception might
be a printer CSS).
And again, what is a better alternative to pt?
>>then there is less
programming that has to be done. But, since you're an idiot, I wouldn't
expect you to relate php with anything web-related.

You should learn HTML and CSS and ask in the appropriate authoring
newsgroups how to do things properly without browser sniffing.

Still nothing to do with PHP.
I'd agree with this one, but you should notice that I did not bring up the
subject at all. I merely asked a question about a comment made in the course
of this thread.
Jul 1 '08 #24

"Mark A. Boyd" <li*******@mboydDotcom.invalidwrote in message
news:Xn********************************@194.177.96 .26...
"Barry" <no****@example.composted in comp.lang.php:
>>
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:g4**********@registered.motzarella.org...
>>Jeff wrote:
Barry wrote:
"Jeff" <jeff@spam_me_not.comwrote in message
news:Ca******************************@earthlin k.com...
>Barry wrote:
>>I know this is not a php question. If that bothers you, don't
>>respond. If not, I sure could use the advice...
>Barry, you should learn something from this.
>>
>You've asked an OT question without bothering to ask in the group it
>would be on topic for. Then you've wasted a lot of time arguing
>about this. Just look at the length of the thread.
>
hey jeff. i actually did ask the question in two javascript
newsgroups. after not getting any hits, i asked here. as for my time,
i appreciate your consideration thereof.
>
> BTW, what's with all the inline styles? You could benefit by
> learning
>about CSS descendants, a few classes, and adding a small stylesheet.
>And, don't use points.
>
i'm doing that now. i worked up a static version so i could tweak the
appearance and find what the best patterns were to make into the css
classes.
>
btw, what's wrong with points?

Historically points are defined by what the OS determines the height
of 1" is in pixels. PCs settled on 72, Macs on 90 (I believe). So
there's quite a size discrepancy if you view on a Mac. That can be
particularly bad for small font sizes. Not sure where this issue
stands now...

Jeff
>
thanks.
>
Jeff,

Please take this to a more appropriate forum. Font sizes are not
related to php. And discussing off-topic subjects just encourages more
of the same - especially with Barry.

Font sizes are php related. I use php to get the OS and browser to
adjust font sizes to make them the size I want, uniformly. If using px
or em instead of doing the php detection and using pt, then there is
less programming that has to be done. But, since you're an idiot, I
wouldn't expect you to relate php with anything web-related.

Good grief. By that logic, everything is PHP related. "I use PHP to get
the OS and browser to display my
Web pages about <any topic whatsoever>. How do I get PHP to show white
text on a black background?
What image(s) should I use to convey <any topic whatsoever>? What sources
should I cite for <any
topic whatsoever>? I'm using PHP, so I expect an answer in here!"
Perhaps you missed that I didn't bring it up. Since it was brought up, I
simply asked if using something other that points for font sizes would keep
me from having to code OS/browser detection. Still, php is primarily for the
web. Since that involves html, css, et. al., anytime one has a problem using
php to deliver such effects do, in fact, relate and are on topic. I get your
point, however, much of that is masked in straw gathered into the shape of
men.
If, for some reason, you feel you must post OT in any newsgroup, the
general netiquette is to include OT
Point taken.

Cheers

<snip>
Jul 1 '08 #25
On Jul 1, 5:33*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Barry wrote:

ers again.
Grow up, Jerry.

Yep, you need to grow up, Barry. *Poor little boy threw a temper tantrum
and now needs his diapers changed!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Good play. Both become sticky.

See these lines can help you:
Here is a line to put in the first function call for your cal.

// for Div, close on click anywhere in document except div itself
document.all?
document.attachEvent('onclick',checkToClose):docum ent.addEventListener('click',checkToClose,false);

and, Here are functions used by the above line:

function isChild(s,d) {
// s is child of d ?
while(s) {

if (s==d) return true;
s=s.parentNode;
}
return false;
}
function checkToClose(e) {

evt = e ? e : event;
trigElem = evt.target ? evt.target : evt.srcElement;

if (divDiv) {

if (!isChild(trigElem, divDiv)) {
if (trigElem != calTriggerBtn) closeDiv();
}
}
}

http://satya61229.blogspot.com/
Jul 2 '08 #26
..oO(Barry)
>"Michael Fesser" <ne*****@gmx.dewrote in message
news:44********************************@4ax.com.. .
>>
Such sniffing is almost always a sure sign of a poor layout or broken
code. And what do the OS and browser have to do with font sizes at all?

Different OS's render fonts differently, however even on the same OS, you
can still have a varied appearance given the browser being used. You should
know that.
Sure I know that, because it's simply the way the Web works. It's not a
fixed medium like a sheet of paper, it's a flexible one. And I don't
have any problem with that. After all the Web is not about forcing a
particular layout onto the users, but to make _suggestions_ to the
user's browsers. It's their choice which of these suggestions to follow
and which to ignore. The user always has the last word and can change
almost everything.
>>>If using px or em
instead of doing the php detection and using pt

Using pt in a stylesheet is even more stupid (the only exception might
be a printer CSS).

And again, what is a better alternative to pt?
em or % are still the most usable ways for specifying font sizes. They
take the user's preferred size into account and scale nicely.

pt, in, cm etc. OTOH will give highly unpredictable results, because
they depend on a system-specific option (DPI/PPI) so that the browsers
can turn them into a pixel size. But what is 12pt measured in pixels?
You simply don't know. Some systems use 72dpi, others use 96dpi to do
this conversion, although both are incorrect in most cases. The correct
setting depends on the used resolution and the screen size, but almost
no user knows how to properly configure that.

Micha
Jul 2 '08 #27

"Satya" <sa********@gmail.comwrote in message
news:84**********************************@u6g2000p rc.googlegroups.com...
On Jul 1, 5:33 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Barry wrote:

ers again.
Grow up, Jerry.

Yep, you need to grow up, Barry. Poor little boy threw a temper tantrum
and now needs his diapers changed!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================
Good play. Both become sticky.

Thanks Satya!
Jul 2 '08 #28

"Michael Fesser" <ne*****@gmx.dewrote in message
news:s0********************************@4ax.com...
.oO(Barry)
>>"Michael Fesser" <ne*****@gmx.dewrote in message
news:44********************************@4ax.com. ..
>>>
Such sniffing is almost always a sure sign of a poor layout or broken
code. And what do the OS and browser have to do with font sizes at all?

Different OS's render fonts differently, however even on the same OS, you
can still have a varied appearance given the browser being used. You
should
know that.

Sure I know that, because it's simply the way the Web works. It's not a
fixed medium like a sheet of paper, it's a flexible one. And I don't
have any problem with that. After all the Web is not about forcing a
particular layout onto the users, but to make _suggestions_ to the
user's browsers. It's their choice which of these suggestions to follow
and which to ignore. The user always has the last word and can change
almost everything.
>>>>If using px or em
instead of doing the php detection and using pt

Using pt in a stylesheet is even more stupid (the only exception might
be a printer CSS).

And again, what is a better alternative to pt?

em or % are still the most usable ways for specifying font sizes. They
take the user's preferred size into account and scale nicely.

pt, in, cm etc. OTOH will give highly unpredictable results, because
they depend on a system-specific option (DPI/PPI) so that the browsers
can turn them into a pixel size. But what is 12pt measured in pixels?
You simply don't know. Some systems use 72dpi, others use 96dpi to do
this conversion, although both are incorrect in most cases. The correct
setting depends on the used resolution and the screen size, but almost
no user knows how to properly configure that.
Thanks Micha.
Jul 2 '08 #29
On Tue, 1 Jul 2008 18:29:50 -0500, "Barry" <no****@example.comwrote
in <C5***************@newsfe03.lga>:
>
And if you had a problem creating the functionality in php to do that, you'd
probably ask it here. Your point isn't very poigniant.
I would have followed up privately by email, but your headers don't
contain a valid email address.

FYI, "poignant" (not "poigniant") doesn't mean what you think it does.
You mean "pertinent".

Definition of poignant:
<http://dictionary.reference.com/search?r=2&q=poignant>

Definition of pertinent:
<http://dictionary.reference.com/search?r=2&q=pertinent>
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research
Aug 9 '08 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
22
by: Rafia Tapia | last post by:
Hi all This is what I have in mind and I will appreciate any suggestions. I am trying to create a xml help system for my application. The schema of the xml file will be <helpsystem> <help...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.