
Originally Posted by
Ges
Sorry Professor.
Those titles are added automatically by the forum software based on post count. 
I am basically trying to show a set of thumbnails where you can select one by clicking on it.
Place radio buttons alongside or under each thumbnail, and use those to identify the selected thumbnail.
A few notes:
Documents should start with a document type declaration (DOCTYPE). When both a formal public identifier (like "-//W3C//DTD HTML 4.01//EN") and a system identifier ("http://www.w3.org/TR/html4/strict.dtd" corresponds with that FPI) are present, browsers that switch between "Quirks" and "Standards" rendering modes will use the latter. This leads to more consistent and predictable behaviour across user agents.
<script language=javascript>
The language attribute has been deprecated for years. Use the type attribute, instead:
HTML Code:
<script type="text/javascript">
function testingPage ()
{
myWin=open('', 'testwindow',
All variables should be explicitly declared (especially global ones to avoid falling foul of IE silliness).
'width=950,height=550,status=yes,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes');
Boolean features just have to be present to be enabled. That is:
Code:
'width=950,height=550,status,toolbar,menubar,scrollbars,resizable'
Then again, relying on pop-ups isn't typically a good idea these days.
document.result.endresult.value="<html><head><title>Page Test</title>\
Don't use a backslash to split string literals: it's forbidden in ECMAScript, and no derivative (to my knowledge) formally supports it.
The most efficient alternative is to define an array, which you then join with a new line between each element:
Code:
document.forms.result.elements.endresult.value
= ['<html><head><title>Page Test<\/title>',
'<link rel="stylesheet" href="pagedem.css">',
'<\/head>',
'<body background="my_pic.jpg" bgproperties="fixed">',
/* ... */ ].join('\n');
The character sequence "</" should not occur inside a script or style element, as this is allowed to be considered the end of the element. As shown above, in a string literal, the slash can be escaped to break apart this sequence (into "<\/").
The width attribute does not include units: it is always interpreted as pixels. In CSS, the situation is different as units are always required for any non-zero length value.
Get into the habit of quoting all attribute values. Some characters are not permitted unquoted (and an asterisk is one of them).
When I add the picture input stuff I get the error 'document.ges.my_pic.value is null or not an object'.
The element has not been added as form element. I don't know why (there's no real reason not to), but nevertheless it hasn't. It is possible to use an alternate approach, but there's no need to as the images should simply be images, and radio buttons should indicated the chosen one.
Mike
Bookmarks