Copy link to clipboard
Copied
How would I input a javascript for onFocus that says the alt key and down arrow are pressed (even though they arent)?
event.altKey==true
I know that is how you get the alt key to say it is pressed, but how do you do the down arrow with it (combination)?
The Keycode for the down arrow is 40 but I don't know how to link it to the alt key saying both are pressed even when they arent.
Any help would be amazing. Thanks.
1 Correct answer
You should use a separate field (a text field) that you can display when Other is selected for the user to fill in additional information.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I don't think it's possible. These kind of properties are typically
read-only.
On Wed, Jan 20, 2016 at 8:48 PM, Italian4215 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
If that isn't possible then how would I make it so that if for example the word "Other" was selected from a drop down menu to make the drop down editable with the cursor in the field and a default of "Please enter your name" else it is just a regular dropdown and not editable?
Copy link to clipboard
Copied
You should use a separate field (a text field) that you can display when Other is selected for the user to fill in additional information.
Copy link to clipboard
Copied
How would I code it so that I know "Other" is selected? Would I use .value? or is there something else I could use for dropdowns? Thanks
Copy link to clipboard
Copied
Yes, use the value property. If you do it in the field's custom validation
event use event.value to access the newly selected item.
On Thu, Jan 21, 2016 at 3:10 PM, Italian4215 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Okay one more question, how do I make it set focus to the text field with text highlighted?
Copy link to clipboard
Copied
Not possible.
Copy link to clipboard
Copied
Actually it is, I just did it.
if (this.getField('Sender_Name').value=="Other") {
this.getField('SName').value = "Please Enter Your Name";
this.getField("SName").display = display.visible;
this.getField('SName').setFocus();
}
else{
this.getField('SName').value = this.getField('Sender_Name').value;
this.getField("SName").display = display.hidden;
}
Apparently if there is text in the text field and setFocus is set to that field, it automatically highlights the text.
Copy link to clipboard
Copied
I had remembered it just sets the focus to the field. Didn't remember it also selects the text... Sorry about the misinformation.
Copy link to clipboard
Copied
With this current code it works; however, since the text field is set to .setFocus() when the value of the dropdown is "Other" it doesn't allow me to use the dropdown arrow once it focuses on the text field. Is there a way around this?
var Name = this.getField('Sender_Name');
var SN = this.getField('SName');
if (SN.value=="Other") {
Name.value = "Please Enter a Sender Name";
Name.display = display.visible;
Name.setFocus();
}
else{
Name.value = SN.value;
Name.display = display.noView;
}
Copy link to clipboard
Copied
Where did you place this code?
Copy link to clipboard
Copied
It's in the format code for the dropdown
Copy link to clipboard
Copied
I got it to work by changing the .setFocus() to .bringToFront()
Only issue is the default text isn't highlighted now. Is there a way I can get it to be highlighted (another words get the text to be selected)?
Copy link to clipboard
Copied
Figured out an alternative. I put this bit of code in the onFocus - run javascript of the field:
if(event.target.value=="Please Enter a Sender Name"){
event.target.value ="";
}
This way when focus is brought to the field, that ghost text will you disapears and they can type what they want in the field.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Apparently the KeyDown function is not allowed when you have an editable dropdown. So I am going to do what Try67 mentioned above.

