Magic Files

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Magic Files

Post by AhmedBR » 2013-09-28 15:20

Hi,

I am using the following Code in Magic Files and works very well:

Code: Select all

 document.observe('dom:loaded', function() {
$('NetWeight').observe('change', function() {
if(isNaN($('NetWeight')) || $('NetWeight') > $('MaxQuantity') || $F('NetWeight') < 0){
alert('Error on Net Weight!');
var elem = document.getElementById("NetWeight");
elem.value = "1";
$('NetWeight').focus();
}
});
});
My problem is I cannot set elem.value = $('MaxQuantity') no matter what I try.
Any ideas how to set elem.value to be equal to Max Quantity?

Thanks
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Magic Files

Post by AhmedBR » 2013-09-28 23:17

Found out the problem, but still no solution.
MaxQuantity is a lookup field and if its value was not set on load, it stays Undefined!
Got no idea how to solve this for now :?: :!:
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

AhmedBR
AppGini Super Hero
AppGini Super Hero
Posts: 327
Joined: 2013-09-19 10:23

Re: Magic Files

Post by AhmedBR » 2013-10-01 19:18

Solved the problem by creating another field that is not LOOKUP, and used it to do the comparison.
That is it.
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper

Post Reply