Omar
|
| Posted: 02/22/2002, 9:06 PM |
|
Say there is a form of Record type, with 5 feilds, key feild is a ListBox, I like to have the second feild (type label) to get populated after I select a value in the listbox.
Exmp Milestone_feild (Invoiced) will show the status_feild(Financial Transaction created).
thx
|
|
|
 |
Nicole
|
| Posted: 02/23/2002, 2:07 AM |
|
Omar,
it could be done via JavaScript. Refer to Dependent Listboxes article: http://www.gotocode.com/art.asp?art_id=45&
But JavaScript doesn't work with Label type fields. The workaround is to use read only textbox field instead Label.
|
|
|
 |
Andrew B
|
| Posted: 02/24/2002, 5:49 PM |
|
You are going to want to make a disabled textbox, like was said. If this is IE only, then you can use the innerHtml property (wrong case, i think) to replace the label text, but it gets sketchier doing that with NS/Opera/etc.
You want to make a script area in the form footer and do something like this :
<script language="javascript">
var f;
f = document.forms['MyFormName'];
f.SelectBoxName.onchange = WhenItChanges;
function WhenItChanges() {
f.DisabledTextBox.text = f.SelectBox.value;
}
</script>
If you don't want the 'value' field because it is a number, but you want the text field, then you are going to need to replace that last line with :
f.DisabledTextBox.text = f.SelectBox.options[f.SelectBox.selectedIndex].text;
It also works with hidden values.
|
|
|
 |
|