peterinwa
03-07-2003, 11:16 PM
By calling a function that contains:
document.form1.sex.value="F";
I can change the content of:
<form name=form1>
<input type=text name=sex value="M" size=1 maxlength=1 border=1>
I can see the change take place on my page without needing to re-create the page.
Similarly, by calling a function that contains:
document.form1.results.value="new text";
I can change the content of:
<form name=form1>
<textarea name=results border=1 cols=50 rows=20>"original text"</textarea>
Again, I can see the change take place on my page without needing to re-create the page.
But I am having trouble changing the display of a drop down menu. I have a few on the page, and when something is selected from one of the drop down menus I want the others to automatically changed to indicate that they are available but not selected for use at the moment.
The drop down menu is:
<form name=form1><select name=list1 onChange='selectList(1)'>
<option value=0>General Food List
<option...
To try to change what it reads I have tried:
document.form1.list1[document.form1.list1.selectedIndex].value="new text";
Which does nothing, and the following which makes the text on the drop down menu go blank:
document.form1.list1.value="new text";
Can this be done? I somehow want it to be clear which drop down menu is currently being used, which would always be the last one from which a selection was made.
document.form1.sex.value="F";
I can change the content of:
<form name=form1>
<input type=text name=sex value="M" size=1 maxlength=1 border=1>
I can see the change take place on my page without needing to re-create the page.
Similarly, by calling a function that contains:
document.form1.results.value="new text";
I can change the content of:
<form name=form1>
<textarea name=results border=1 cols=50 rows=20>"original text"</textarea>
Again, I can see the change take place on my page without needing to re-create the page.
But I am having trouble changing the display of a drop down menu. I have a few on the page, and when something is selected from one of the drop down menus I want the others to automatically changed to indicate that they are available but not selected for use at the moment.
The drop down menu is:
<form name=form1><select name=list1 onChange='selectList(1)'>
<option value=0>General Food List
<option...
To try to change what it reads I have tried:
document.form1.list1[document.form1.list1.selectedIndex].value="new text";
Which does nothing, and the following which makes the text on the drop down menu go blank:
document.form1.list1.value="new text";
Can this be done? I somehow want it to be clear which drop down menu is currently being used, which would always be the last one from which a selection was made.