mx3/mx — Issue #48: JS to find related records on new record forms
Author: mjy
Created: 2012-02-22 16:09:51+00:00
State: open
Labels: tasks

We need a generic bit of code, similar to the ajax autocomplete/autofill fields that populates some div based on changes to the input box.

The example is user clicks to create a new OTU. User starts to fill in the "name" field for the OTU. As user types we get an AJAX request that populates a div with a list of OTUs that share that string. This is very similar to the autocomplete (in fact we might extend the autocomplete code) but it presents the list of results within some associated div.

data-find-similar-on-change=true
data-find-similar-on-change-target=some_div_id
data-find-similar-on-change-search-type=some_name_to_be_used_in_a_case_statement (i.e. selects the type of search result to look for)

Alternately- another solution would be to be slightly less real-time. 1) On change of an element a button appears beside element that says: "find similar". When clicked it submits the existing field to a search request of a certain type, and populates the related div.

Clear as mud?