javascript to select field from dropdown list?
asking if a javascript can be written to unhide and select a field based on a selection from a dropdown list?
asking if a javascript can be written to unhide and select a field based on a selection from a dropdown list?
I used the following code:
Var otherField = this.getField(“2nd Lock Template”);
If (event.value==”Other (Complete Below)” {
otherField.readonly = false
otherField.setFocus();}
else
otherField.readonly = true
otherField.value = “”;}
Is there any way I can keep “2nd Lock Template” hidden and unhide in this code?
Thanks
Tom
Yes, by using this code:
var otherField = this.getField("2nd Lock Template");
if (event.value=="Other (Complete Below)") {
otherField.display = display.visible;
otherField.readonly = false;
otherField.setFocus();
} else {
otherField.display = display.hidden;
otherField.readonly = true;
otherField.value = "";
}
By the way, I noticed that in your code there are various problems. Do not use Word for editing code! Only use a plain-text editor, like Notepad.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.