You are viewing limited content. For full access, please sign in.

Question

Question

set dropdown default to blank - 11 new designer

asked on February 21

Anyone figure this one out?

This is a dropdown with a lookup on it. When there is only one result, it auto-selects the one result. I need to to NOT auto-select that result and stay blank.



Thanks so much!

0 0

Replies

replied on February 21

If the field is marked required then it should remove the blank.

1 0
replied on February 21

I actually want the blank set as the default. And....I can't make it required per the business rules. 

0 0
replied on February 21 Show version history

Ok I got this going. I added the class 'defaultBlank' to the drop downs I need blank.

//set drop downs default to blank
function setBlankFields() {
    LFForm.findFieldsByClassName("defaultBlank").forEach(function (field) {
        let fID = field.fieldId;
        if (fID) {
            LFForm.setFieldValues({fieldId: fID, index: 0}, " ");
        } 
    });
}
// Run immediately if fields exist
setBlankFields();

 

1 0
replied on February 21

Oh I see what you are saying now.  Sorry I misunderstood what you were trying to accomplish.  

1 0
replied on February 25

By default a lookup with a single result will be automatically selected. This works on all lookup-supported field types. If you want it to not select that as a result your lookup should return a blank value (i.e., two results)

 

But i'm glad you found a JS workaround

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.