pro_imaj Posted January 29, 2017 Posted January 29, 2017 Merhaba; Simple Prompt örneğini inceliyorum, veri girişini sadece sayısal zorunlu girişe nasıl çevirebilrim. Saygılarımla Teşekkürler. Quote
pro_imaj Posted January 30, 2017 Author Posted January 30, 2017 Prompt kullanırken Screen Mask'te çıkan mesajı nasıl değiştirebilirim. Quote
Sherzod Posted January 30, 2017 Posted January 30, 2017 Merhaba; Simple Prompt örneğini inceliyorum, veri girişini sadece sayısal zorunlu girişe nasıl çevirebilrim. Saygılarımla Teşekkürler. Hi, Do you want allow to the user to enter only numbers ?! Quote
pro_imaj Posted January 30, 2017 Author Posted January 30, 2017 Yes, I just want the number to be entered Quote
Sherzod Posted January 31, 2017 Posted January 31, 2017 Hi, Then, can you try this approach for now?!: For example: procedure TMainForm.UniButton1Click(Sender: TObject); begin Prompt('Please enter a number', '', mtInformation, mbOKCancel, PromptCallBack); // --> UniSession.AddJS('Ext.get("messagebox-1001-textfield-inputEl").on("keydown", '+ 'function(e) {var code = e.browserEvent.keyCode; if (!(code>=48&&code<=57)&&!(code>=97&&code<=105)&&code!==46&&code!==8) '+ '{e.stopEvent();}})'); end; procedure TMainForm.PromptCallBack(Sender: TComponent; AResult:Integer; AText: string); begin if AResult = mrOK then begin UniMemo1.Lines.Add(AText); end; UniSession.AddJS('Ext.get("messagebox-1001-textfield-inputEl").un("keydown")'); //<-- end; Best regards. Quote
Sherzod Posted January 31, 2017 Posted January 31, 2017 but still need to think about "paste" from the "context menu"... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.