Reputation: 863
I have a field in my form of a custom entity that I would like to be populated with an auto-generated number on form load. The number should start from 1000 for the first ever form record and for every new record it should increment like 1001, 1002 and so on.
I am not good with programming so I need help.
Regards
Upvotes: 1
Views: 3295
Reputation: 1683
If you want to do it by code :
var i = 0;
var n = 0;
$("body input:text").each(function(){
if(i==0) n = 1000;
else n++;
$(this).val(n);
i++;
});
Demo : http://jsfiddle.net/ufJ56/2/
Upvotes: 1
Reputation: 15128
You can install one of the autonumbering solutions available on codeplex:
http://advcrm2011autonumber.codeplex.com/
http://crm2011autonumber.codeplex.com/
Personally I suggest the first one.
both are free
Upvotes: 1