Why when I enter a value in the edit field 08 or 09, the text displays 0 or 00? Other numbers are displayed normally. But if I enter only 8 or 9 (without 0 in front) all OK.
I do not understand where is the problem
Attachment:
preview.png [ 36.29 KiB | Viewed 3996 times ]
My code:
function buttOKOnClick(Sender)
{
ah = parseInt(edit_h.Text);
text_h.text=ah;
if (ah>23)
{
timercore5.Enabled = true;
text_h.text="- ";
}
if (edit_h.Text=="")
{
timercore5.Enabled = true;
text_h.text="- ";
}
am = parseInt(edit_m.Text);
text_m.text=am;
if (am<10)
{
text_m.text=("0"+am);
}
if (am>59)
{
timercore5.Enabled = true;
text_m.text=" -";
}
if (edit_m.Text=="")
{
timercore5.Enabled = true;
text_m.text=" -";
}
timercore5.Enabled = true;
alarmTime.visible = true;
msg.visible = true;
memo.visible = false;
alarm.visible = false;
imAlarm.visible = true;
imAlarm1.visible = false;
}
function timercore5OnUpdate(Sender)
{
if (hours.text==ah)
{
if(minutes.text==am)
{
T23OnClick();
PlaySound("sound.wav");
time_Zone.visible = false;
bell_hourly.visible = false;
clock_calendar.visible = true;
alarmTime1.visible = true;
alarmTime.visible = false;
alarmTime1.InitAnimateChange;
alarmTime1.AnimateChange.Style = 21;
alarmTime1.StartAnimateChange;
edit_h.text="";
edit_m.text="";
text_h.text="";
text_m.text="";
text_h1.text=ah;
text_m1.text=am;
}
else
{
alarmTime1.visible = false;
}
}
}