View Single Post
Old 02-04-2005, 01:39 PM   #5 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 122
metazai is on a distinguished road
Well, it just goes to show you . . . I came up with a complicated parser that will break open any line put in the array, pick out the http:// prefix, and automatically link the item for you, and Redhead comes along and just hardcodes it, which is the simpler fix if you're putting in the array elements yourself.

Bottom line . . . Redhead is absolutely right, especially about document.Calendar.dateInfo.value needing to not be a form element (links won't work directly within form elements).

At any rate, here's my extended solution, in case you're curious:

Code:
function showDate(thisDay)
{
var parts=daySchedule[thisDay].split(' ');
var i=0;
subpiece = new Array
for (var i=0; i<parts.length; i++) {
subpiece[i] = parts[i].substring(0,7);
if (subpiece[i] == "http://") {
parts[i]="<a href=\"" + parts[i] + "\">" + parts[i] + "</a>";
}}
daySchedule[1]=parts.join(' ');
document.Calendar.dateInfo.value = daySchedule[thisDay]
}
metazai is offline   Reply With Quote