I
ioneabu
I am trying to do the basic task of setting a text field from the
choice made from a select box. I learned how to code it from my
O'Reilly Javascript reference which is a few years old. The code works
as expected in Safari but not Firefox which is where I really need it
to work primarily. Of course, I would like it to work everywhere. I
would greatly appreciate it if someone could point out my error. I did
check to make sure that all javascript functionality is enabled in
Firefox. Thank you!
wana
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"><head><title>Untitled Document</title>
<script>
function set_text()
{
myform.mytext.value =
myform.myscroll.options[myform.myscroll.selectedIndex].text;
}
</script>
</head><body>
<form method="post" action="/./s.pl"
enctype="application/x-www-form-urlencoded" name="myform">
<select name="myscroll" size="7" onchange="set_text()">
<option value="laboratory report">laboratory report</option>
<option value="specialist consult note">specialist consult
note</option>
<option value="hospital discharge summary">hospital discharge
summary</option>
<option value="ER discharge">ER discharge</option>
<option value="medical records">medical records</option>
<option value="prescriptions">prescriptions</option>
<option value="audio dictation">audio dictation</option>
</select>
<br />
<input type="text" name="mytext" />
<div>
<input type="hidden" name=".cgifields" value="myscroll" />
</div>
</form>
</body></html>
choice made from a select box. I learned how to code it from my
O'Reilly Javascript reference which is a few years old. The code works
as expected in Safari but not Firefox which is where I really need it
to work primarily. Of course, I would like it to work everywhere. I
would greatly appreciate it if someone could point out my error. I did
check to make sure that all javascript functionality is enabled in
Firefox. Thank you!
wana
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"><head><title>Untitled Document</title>
<script>
function set_text()
{
myform.mytext.value =
myform.myscroll.options[myform.myscroll.selectedIndex].text;
}
</script>
</head><body>
<form method="post" action="/./s.pl"
enctype="application/x-www-form-urlencoded" name="myform">
<select name="myscroll" size="7" onchange="set_text()">
<option value="laboratory report">laboratory report</option>
<option value="specialist consult note">specialist consult
note</option>
<option value="hospital discharge summary">hospital discharge
summary</option>
<option value="ER discharge">ER discharge</option>
<option value="medical records">medical records</option>
<option value="prescriptions">prescriptions</option>
<option value="audio dictation">audio dictation</option>
</select>
<br />
<input type="text" name="mytext" />
<div>
<input type="hidden" name=".cgifields" value="myscroll" />
</div>
</form>
</body></html>