is it possible to split a two digit variable into two input fields, for example:
lets say i have a variable var age = 23; and i want to split that to <input class="age" id = "age1" /> and <input class="age" id = "age2" /> so that age1’s value is 2 and age2’s value is 3.
Any Help Greatly appreciated…
this is how i am getting the value of age:
$.each(age_input_groups , function(i){
var id = 'age-group-'+g_counter;
var agevalues = $.map($('#'+id + ' input') , function(e,i){
return $(e).val(age);
});
});
Here is how you can do this:
And an example.
For your case you can use the following JavaScript:
With:
One more example. If you have a list of ages you can use this.
And last example with the final solution.