Page 1 of 1

A Random DEFAULT value

Posted: 2016-08-29 04:17
by buck1942
A Random DEFAULT value would be very handy once in awhile, from the Appgini main screen, in addition to the current support for a "constant" value.

Just sayin'... :o)

Buck

Re: A Random DEFAULT value

Posted: 2016-09-01 10:03
by Aya Adel
Add this code to the hooks/tablename-dv.js put this code:

Code: Select all

$j(function(){
    var x =$j('#tableID').val(); 
        if (!x){   
            var rand = Math.floor(Math.random()*100);  
            $j('#elementThatWantToPutRandomValue').val(rand);
        }
});