I am trying to preserve the type of values written into a text input when saving them to the Database.
So far I have set the type of the input to number (<input id="x" type="number" />) and chequed for $("#x").attr("type").
When I parseInt the value, this is o.k. for Integers. But what to do with Floats?
Simple. Test for typeof $("#x").(). If it is number, check if parseFloat($("#x").()) !== parseInt($("#x").()).
Unfortunately typeof $("#x").() ALWAYS returns string.
What am i missing?
Cheers, Alex