Message Box
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Message Box
Does anyone know how to make a message box pop up if a condition is met? For instance, if a value is >= 100.00 then popup a message box that states "This value is too high, check your data input". This doesn't have to stop input, or throw an error, just a warning message.
Thank you,
David
Thank you,
David
Re: Message Box
Hi,
you can try to use:
you can try to use:
Code: Select all
show_notification({
message: "YOUR MESSAGE HERE",
class: 'danger',
dismiss_seconds: 30
});
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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
Thank you Pascal,
One other thing. Where would be best to put this code? and would this be appropriate?
if($j('#eff_percent').val() >= 100.00)
show_notification({
message: "This is High. Please check your data",
class: 'danger',
dismiss_seconds: 300
});
Thanks again,
David
One other thing. Where would be best to put this code? and would this be appropriate?
if($j('#eff_percent').val() >= 100.00)
show_notification({
message: "This is High. Please check your data",
class: 'danger',
dismiss_seconds: 300
});
Thanks again,
David
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Message Box
javascript
alert box
confirm box
alert box
Code: Select all
alert('MESSAGE HERE');
confirm box
Code: Select all
var txt;
var r = confirm("Are you sure?");
if (r == true) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
Much appreciated, but where would this code need to be placed?
Thank you,
David
Thank you,
David
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
Screen shots;
One is the eff.php file and the other is the eff Detail View.
Thank you,
David
One is the eff.php file and the other is the eff Detail View.
Thank you,
David
- Attachments
-
- eff_detail_view.JPG (54.8 KiB) Viewed 34529 times
-
- eff_php.JPG (81.26 KiB) Viewed 34529 times
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Message Box
dharbitindy wrote: ↑2020-03-04 18:59Screen shots;
One is the eff.php file and the other is the eff Detail View.
Thank you,
David
hooks/eff-dv.js
Code: Select all
$j(function{
if ( $j('#eff_percent').val() >= 100 ){
alert('This is High. Please check your data');
}
});
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
Thank you! I'll give it a try. Much appreciated.
David
David
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
D Oliveira,
Thank you, but this unfortunately didn't show a message. I appreciate your input though.
David
Thank you, but this unfortunately didn't show a message. I appreciate your input though.
David
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Message Box
try this:dharbitindy wrote: ↑2020-03-05 02:28D Oliveira,
Thank you, but this unfortunately didn't show a message. I appreciate your input though.
David
Code: Select all
$j('#eff_percent').on('change', function(){
if ( $j('#eff_percent').val() >= 100 ){
alert('This is High. Please check your data');
}
});
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
This did show the message if I change the value of the eff_percent field however; that is a calculated field so, I think that if I do the calculation in AppGini rather than in the eff.php file, this eff-dv.js code may work. I'll try that and let you know.
Thank you,
David
Thank you,
David
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
Unfortunately that didn't work correctly either. Unless the calculated field value changes (eff_percent) when either the good_parts, or the hrs_ran value(s) change, the message won't show up correctly. It's definitely closer, but not quite working yet. Thanks again though.
David
David
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Message Box
try calculating the field through javascript instead of using appgini built in function.dharbitindy wrote: ↑2020-03-05 19:37Unfortunately that didn't work correctly either. Unless the calculated field value changes (eff_percent) when either the good_parts, or the hrs_ran value(s) change, the message won't show up correctly. It's definitely closer, but not quite working yet. Thanks again though.
David
Code: Select all
$j('#field_a, #field_b').on('change', function(){
var sum_total = Number($j('#field_a').val()) + Number($j('#field_b').val()) ; // use + or - or / or *
$j('#eff_percent').val(sum_total);
if ( $j('#eff_percent').val() >= 100 ){
alert('This is High. Please check your data');
}
});
$j('#eff_percent').on('change', function(){
if ( $j('#eff_percent').val() >= 100 ){
alert('This is High. Please check your data');
}
});
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Message Box
Thank you sir! I'll try it.
David
David