"Dennis M. Marks" <de******@yahoo.com> writes:
If you go to my page http://www.dcs-chico.com/~denmarks/relative.html
....
I am currently using a text input form which works but does not seem
to be the best option. I would rather just have the text appear
directly on the page (without redrawing the page) and not within a
text box.
I think it looks fine. It is also the most compatible way of adding
information to a page. Other methods are:
- Netscape 4 layers
- IE 4+ innerHTML
- W3C DOM node manipulation (IE 5+,Mozilla, Opera 7, etc.)
- Iframe and document.write to it (don't know exactly which browsers).
No browser supports all of these, and none of these methods are supported
by all browsers.
Using a text input element works in all of these browser and more. In
some browsers, it is the *only* way to add content after the page has
loaded.
So, if you really want to use another method, you must tell us which
browsers needs to be supported. Then we can tell you how to do it.
(There is something about it in the FAQ too:
<URL:http://jibbering.com/faq/#FAQ4_15>)
If it looks so bad, style it:
<style type="text/css">
#output {
background: #0ff;
border:0px solid #0ff;
font: inherit;
}
</style>
and give the output field id="output". That should make it look like normal
text in those browsers that allow it.
Another problem is that even though the box is read only,
if someone places the curser in the box and presses return a file
not found message appears.
Your form element is generally not necessary if you don't want to
submit the form anyway. However, Netscape 4 only allows form controls
inside a form element, and it makes addressing the controls much easier.
A typical sign that you don't use the form element for submitting is
that you don't know what to write in the "action" attribute. You have
written "post", which should really be in the "method" attribute. The
"action" attribute should contain an URL.
If you don't have access to server side scripting, so you could make
the application work even if the client have no Javascript available,
I would let the "action" URL point to a page that explains that the
page needs Javascript to work. Then I would add an onsubmit handler
that prevented the form from being submitted if Javascript is available.
I.e.,
<form id="form" name="form"
method="post" action="noJS.html" onsubmit="return false">
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'