Cascading Dropdown: Watch either of 2 form Elements

tejio3

New Member
On one of my forms, I need to have the user enter either a valid serial number or asset tag number from which I can retrieve an equipment record id from a different db table. Essentially, I need the functionality of a cascading dropdown element that can watch one of two different form elements instead of just the standard one.

My initial thought was to create 2 CDDs, one to watch each of the two text input elements to accomodate the database lookup and then to populate the 'Equipment ID' field with whichever CDD has the most recent update using a JS event. I have exposed the form fields in the attached image for reference.

I love it so far, but I am quite new to Fabrik and just haven't figured out how to make this work on my own. Any help would be much appreciated.
 

Attachments

  • service ticket.png
    service ticket.png
    19.1 KB · Views: 243
Create a hidden input element and use JS actions to copy data from the two fields when they change, and then base the CDD on that.
 
Of course. I suppose I was thinking to far inside the fabrik box! This seems to be working quite nicely.

Thanks for the response.
 
Same case: I have a CDD called ROTACIONES watching a input field called 'campoclaves'. I used JS to change this field's text depending of other elements such dropdowns, checkboxes, etcc. But my CDD is not refreshing or updating as 'campoclaves' changes.
Can you help me? How did you do it?
 
How are you setting the text?

Depending on how you are making the changes, you may need to fire the 'change' or 'blur' event manually.

One reason is that we use different events to trigger the CDD's update, depending on what type of element it is "watching". So for (say) watching a dropdown (like a join) we'll trigger on the 'change' event, but for input fields, it'll be a 'blur' event.

Another is that there can be issues between different frameworks, so doing things in JQuery may not trigger an event that our Mootools code will pick up.

-- hugh
 
I had to chage the point of view and still have problems with triggering 'change' event.

Now I have a list called 'entrevistastrimestralespediatria'.
I have a cascadingdropdown (selection list ) called ROTACIONES whos is watching a databasejoin (dropdown too) called 'selecionaresidente'.

I want to trigger the chage event of the dropdown 'selecionaresidente' with javascript and refresh the selection list 'ROTACIONES'.

Ihave tried both ways, with jquery a Mootools but it does not work:

With jQuery:
jQuery('#entrevistastrimestralespediatria___selecionaresidente').val('557').trigger('change');


With Mootools:
var $resiselected = $('entrevistastrimestralespediatria___selecionaresidente');
$resiselected.value = 557;
$resiselected.trigger("change");

Please, help to make it work.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top