A Random DEFAULT value

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
buck1942
Veteran Member
Posts: 31
Joined: 2016-08-04 02:38

A Random DEFAULT value

Post by buck1942 » 2016-08-29 04:17

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

Aya Adel
Posts: 7
Joined: 2016-08-08 07:29

Re: A Random DEFAULT value

Post by Aya Adel » 2016-09-01 10:03

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);
        }
});

Post Reply