I have an amount field but when the user tabs out the field, if they havn't added a decimal i want to add '.00' when they tab out the field.
Thing is i have no idea on how to do a check if it contains a '.'. I know how to add the '.00'
This is my code so far
function AddDecimalToAmounts()
{
var ApproxAmount = $("#ApproximateValue_TextBox").val();
var ApproxAmountVis = $('#chqAdditional_div').is(':visible');
var UncryAmount = $("#UncryAmount_TextBox").val();
var UncryAmountVis = $('#chqAdditional_div').is(':visible');
if (ApproxAmountVis == true && UncryAmountVis== true)
{
if (//Code for if both amount fields are displayed and to add '.00' or not)
{
}
}
else if (ApproxAmountVis == false && UncryAmountVis== true)
{
if (//Code for if only the UncryAmount amount field is displayed and to add '.00' or not)
{
}
}
else if (ApproxAmountVis == true && UncryAmountVis== false)
{
if (//Code for if only the ApproxAmountVis amount field is displayed and to add '.00' or not)
{
}
}
}