N
Notgiven
Both of the following code smippets work in IE but not in Firefox. The
javascript error for both scripts below is "x has not properties".
The select boxes are shown as arrays since they are generated by Pear's
Quickform - no way around it - I tried.
This code in the html calls the function above and should copy the value
selected in a pull-down list to another field:
<script type="text/javascript">
var x=document.getElementById('fld[2]');
</script>
<script type="text/javascript">function addOption(){
myList = document.getElementById('lfld');
document.forms[0].elements['lfld'].value =
document.forms[0].elements['lfld'].value + x.options[x.selectedIndex].text +
'\n';
}
</script>
<input onclick="addOption()" name="ibutTest" value="Click here to ADD
selected value" type="button" />
The following code should open a new window sending it a parameter to open:
'onClick' => "window.open('page1.php?i=' +
x.options[x.selectedIndex].value,'Name','toolbar=no, menubar=no,
scrollbars=yes, width=600, height=400, top=100, left=100')"
Many many thanks for your help!
javascript error for both scripts below is "x has not properties".
The select boxes are shown as arrays since they are generated by Pear's
Quickform - no way around it - I tried.
This code in the html calls the function above and should copy the value
selected in a pull-down list to another field:
<script type="text/javascript">
var x=document.getElementById('fld[2]');
</script>
<script type="text/javascript">function addOption(){
myList = document.getElementById('lfld');
document.forms[0].elements['lfld'].value =
document.forms[0].elements['lfld'].value + x.options[x.selectedIndex].text +
'\n';
}
</script>
<input onclick="addOption()" name="ibutTest" value="Click here to ADD
selected value" type="button" />
The following code should open a new window sending it a parameter to open:
'onClick' => "window.open('page1.php?i=' +
x.options[x.selectedIndex].value,'Name','toolbar=no, menubar=no,
scrollbars=yes, width=600, height=400, top=100, left=100')"
Many many thanks for your help!