see a POP UP window appear when a field is checked

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

see a POP UP window appear when a field is checked

Post by pasbonte » 2024-03-07 05:59

Hello,
I would like to see a POP UP window appear when a field is checked: if yes WINDOW APPEARS with a blah blah text if not the window does not appear, have you already done so?

Thank you

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: see a POP UP window appear when a field is checked

Post by pbottcher » 2024-03-07 21:02

Hi,

not sure if I get your question completely. Do you want to have the popup when the field is checked, or do you want to have the popup when the page is loaded with the field being already checked?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

pasbonte
Veteran Member
Posts: 162
Joined: 2013-02-06 09:49

Re: see a POP UP window appear when a field is checked

Post by pasbonte » 2024-03-09 08:15

Hello
i have the popup when the field is checked
merci !

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: see a POP UP window appear when a field is checked

Post by peebee » 2024-03-26 02:48

You could try this in your /hooks/tablename-dv.js

For a dropdown - inspect and find your dropdown field #id:

Code: Select all

$j(function() { 
    $j('#your-field-id').on('change', function() {      
      if(jQuery('#your-field-id').val() == 'Yes'){
         alert('Your Alert Here\nThis is a new line in the alert\nThis is another new line'); // popup alert if your selected field is changed to Yes 
         jQuery('#your-field-id').focus();
        }         
    });
});
For radio buttons - you'll need to identify the specific button #id
eg: <input id="your-field-id2" type="radio" name="your-field-id" value="Yes">:

Code: Select all

$j(function() { 
    $j('#your-field-id2').on('change', function() {      
      if(jQuery('#your-field-id2').val() == 'Yes'){
         alert('Your Alert Here\nThis is a new line in the alert\nThis is another new line'); // popup alert if your selected field is changed to Yes 
         jQuery('#your-field-id2').focus();
        }         
    });
});
html formatting won't work in javascript browser alerts but \n will provide a new line if you need one.

Post Reply