Show popup soon after field tab out

  • 1
  • Problem
  • Updated 1 year ago
  • In Progress

Hi Team,

Could you please help me on below requirement,

Is it possible to show a popup soon after tab out from a field?

Requirement is, As seen below screenshot we have 3 fields which are calculated among them (if I update  value in EST.MKT BUDGET  then reaming  two field values  will update based on behind calculation)

We would like show a popup to select a field among 2 fields (assuming 2 fields in pop up with radio button) for user friendly, then the selected field value will be recalculated in the main page instead of popup (Showing a popup with 2 fields to select which field value to get recalculate based on the other field value which we given in main page).

Will be possible from skuid option (I did some trial error but no luck), please help me some input.

Main Requirement: Need to display a pop up with two radio buttons on update and tab out of any field.

Regard’

Photo of Kailas

Kailas

  • 330 Points 250 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Kailas,

There is a very nice write up of how to generate a popup using JavaScript in this community post-> https://community.skuid.com/skuid/topics/trigger_popup_from_javascript

Here is some code that will capture the 'tab' key.  Add this as an 'Inline' snippet (one that runs on the page load).  You'll also need to add a CSS Class to your field in the field editor so you can target the field you want to run this against.  In my example the CSS Class I added is 'firstnm'.

(function(skuid){
    var $ = skuid.$;
    $(document.body).one('pageload',function(){
        //handle tab pressed on field
        $('.firstnm input').keydown(function (e) {
          if (e.which == 9) {
            console.log('Tab key pressed on field');
            /*run your pop up code
            */
          }
        });
    });
})(skuid);

Thanks,

Bill
(Edited)
Photo of Kailas

Kailas

  • 330 Points 250 badge 2x thumb

Hi Bill,

Thanks for your quick turnaround, I will try on your inputs.

Thanks

Kailas