jahlxx Posted June 17, 2016 Posted June 17, 2016 Hi. When a date is not valid the text option of a datetimepicker component is 31/12/1899. Is there any way to get the real text that the user entered? Thanks. Quote
Sherzod Posted June 17, 2016 Posted June 17, 2016 Hi, For now, you can do it approximately as follows: 1. public { Public declarations } DateTimeText: string; end; 2. function blur(sender, e, eOpts) { ajaxRequest(sender, "_change", ["newValue=" + sender.rawValue]) } function boxready(sender, width, height, eOpts) { ajaxRequest(sender, "_change", ["newValue=" + sender.rawValue]) } function change(sender, newValue, oldValue, eOpts) { ajaxRequest(sender, "_change", ["newValue=" + sender.rawValue]) } 3. procedure TMainForm.UniDateTimePicker1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_change' then begin DateTimeText := Params.Values['newValue']; end; end; 4. procedure TMainForm.UniButton1Click(Sender: TObject); begin ShowMessage(DateTimeText); end; Best regards. 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.