javascriptjqueryjsfautocompleterichfaces

Unable to find rich autocomplete id during input validation with jQuery


I have a rich:autocomplete field along with a few text input fields under a rich:panel. During input validation with the following code, all text input fields are found however the rich autocomplete field is not. The id for all input including autocomplete ends with "_REQ" for required. The rich:panel id is passed in as sectionId

$('div[id*="'+sectionId+'"]').find('input[id$="_REQ"]').each(function(){
    
    console.log("found:" + $(this).attr('id') + " ,value:" + $.trim($(this).val()))

    //... validation begins
    
});

Why am I unable to find the rich autocomplete element?


Solution

  • id of autocomplete was changing after deployment, possibly due to JSF.