Forum Discussion

LienGilhooley's avatar
LienGilhooley
Qrew Cadet
5 years ago

Blur event no longer fires now that the select field is a type-ahead-search picker

I had a good amount of custom code that used to fire on a blur event of the old drop-down controls that no longer work since QBase implemented the type-ahead-search pickers.

My existing code:

// ============
// takes the default product specs and populates the 
// input product specs field, allowing the user to modify the value, if needed
// fid_93 = chosen product
// ============
$("#_fid_93").blur(function() {

var DefProductSpecs = $("#tdf_67").text();
$("#_fid_165").next("div[contenteditable]").html(DefProductSpecs);


}); /* $("#_fid_93").blur(function() */ 

Even though the form UI says the Chosen Product field has an ID = 93, the field ID and name and ID in code is no longer "_fid_93" from what I can see using the debugger console/inspector.

What events are available for these new type-ahead-search pickers?  OnChange?  OnBlur?

7 Replies

  • Hi Lien -

    These JavaScript techniques aren't supported by Quick Base and definitely have a high likelihood of breaking as we roll out changes. What is it that you are trying to accomplish? Perhaps it is supported natively.

    We are evaluating ways to continue enhancing the platform and this type of thing is very interesting for us to explore.
  • What I am trying to accomplish is to default multiple field values based on the change of one or two other fields.  I realize this can somewhat be done by the dynamic rules, but it doesn't work exactly that way I need it to work.

    For example,

    if field _fid_93 = "ABC"
    then default _fid_94 = "DEF", _fid_95 = "GHI"

    The form rules can make this happen easily.  The problem comes when the user wants to change the value of _fid_95 from "GHI" to "XYZ" because it's a special case or exception to the rule.  Even though I have the "fire when" checkbox unselected, the user cannot change the value of _fid_95.

    How do I achieve what I'm describing above using form rules?
  • Can you set the Form rule only to fire when the field is blank?  Then it should default, but can be overwritten.