I have a month object and a dropdown field. I'm trying to submit an expiration month to the server but it expects the month to be formatted as a 2 digit integer. How do I do that without turning the number into a string?
My code (using AngularJS):
$scope.months = [01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12];
<select
name="payment"
ng-model="expiration_month"
ng-options="m for m in months"
required>
<option value="">Month</option>
</select>
Problem: it's submitting as 1 rather than 01. I've tried value="01", which keeps the 0 but it submits as a string and as soon as I parseInt() it looses the 0 at the front. Help. Please. Thank you.