Jump to content

Prompt olarak sadece sayısal veri girişi yapılabilecek mesajı nasıl verdire bilirim.


pro_imaj

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...