Alphanumeric reference number

gregwong

New Member
How do I create an auto-increment alphanumeric code based on the user selection? I have used 'calc' to get correct starting code, but I don't know how to add the user selected letters in front of them. I don't want 2 separate fields to make up the reference #.
 
Better use
$v='{listname___elementname}'+10168;
to prevent php errors if the field is empty
 
Better yet to get in the habit of casting to the type you expect, so ...

PHP:
$v = (int)'{listname___elementname}' + 10168;

... which will prevent PHP from tossing a fatal error if listname___elementname is anything other than a number. Also means an empty string gets cast to 0, rather than nothing, which can prevent other PHP errors.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top