wrote:
> I am trying to do the basic task of setting a text field from the
> choice made from a select box. [...] The code works
> as expected in Safari but not Firefox which is where I really need it
> to work primarily. [...]
> The code (generated by the perl module CGI.pm):
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!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" lang="en-US"
> xml:lang="en-US">
XHTML 1.0 Transitional is voodoo. If you don't want clean markup, why are
you using XHTML anyway? There is nothing in your document that requires
it, especially not the deprecated elements and attributes. Use Valid HTML
4.01 Transitional or Strict (I recommend the latter) instead.
> <head>
> <title>Untitled Document</title>
^^^^^^^^^^^^^^^^^
That's a joke, yes?
> <script>
The `type' attribute is missing, both if should be Valid HTML 4 and Valid
XHTML. Validate your markup before you complain: <http://validator.w3.org/>
> function set_text()
> {
> myform.mytext.value =
> myform.myscroll.options[myform.myscroll.selectedIndex].text;
> }
Replace with
function set_text(f)
{
var o = f.elements["myscroll"];
f.elements["mytext"].value = o.options[o.options.selectedIndex].text;
}
> </script>
> </head><body>
> <form method="post" action="/./s.pl"
^^^^^^^
That's voodoo. "/s.pl" will suffice.
> [...]
> <select name="myscroll" size="7" onchange="set_text(this.form)">
Replace with
<select name="myscroll" size="7" onchange="set_text(this.form)">
PointedEars