0
Отвечен
Example to check value in Edit-field
Theo Derks - NL (distributor) 9 лет назад
в Приложения / Studio (Server editor)
•
обновлен Aleksandr Romanov (CTO) 9 лет назад •
3
Hello
Is there anybody who has an example to validate the content of an Edit-box:
- For example: the value has to be between 50 and 100
- Or the length of the entered value has to be < 5 digits
- Etc
Thanks!
Theo
Сервис поддержки клиентов работает на платформе UserEcho
//This one checks to see if the value in the edit box is >= 0 or <= 255
IR.AddListener(IR.EVENT_ITEM_CHANGE,IR.GetItem(Mullions_G1).GetItem("R 1"), function() { var edtText = IR.GetItem(Mullions_G1).GetItem("R 1").Text;if(edtText.Text !=''){
IR.Log("edtText " + edtText)
if(edtText >= 255) { //set the edit box text back to 255
IR.GetItem(Mullions_G1).GetItem("R 1").Text = "255"
}
if (edtText <= 0){ //set the edit box text back to 0
IR.GetItem(Mullions_G1).GetItem("R 1").Text = "0"
}
}
});
Thanks Jackie!
Theo