CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGJQDatePicker current text?

by kattunga » 29 Sep 2014 20:56

Hi I want to validate in server side the text that a user typed in a IWCGJQDatePicker.
But the only property that I have is "Date" and this property have value 0 if text is a wrong date so I can't know if it's a wrong date or if date is empty.
Is there any way to get the original text?
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by Jorge Sousa » 29 Sep 2014 21:49

Hi

The easiest way for both :) is if you add a BrowserParam into the event when you want to validate

BrowserParam.BrowserScript:= '$(<#DatePicker1#>).val()';
BrowserParam.ServerName:= 'DatePicker1Val';
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by kattunga » 29 Sep 2014 23:59

I found easiest to solve it changing sourcecode:

Code: Select all
  TIWCGJQCustomDatePicker = class..
  private
    ...
    FText: string;
  public
    ...
    property Text: string read FText;
  end;

procedure TIWCGJQCustomDatePicker.SetDate(const Value: TDate);
...
    FText := s;
    JQDatePickerOptions.SetDefaultDate(s);
...

procedure TIWCGJQCustomDatePicker.SetValueByName(const AName, AValue : string);
...
    FText := AValue;
  end else if Assigned(FJQValidateOptions) ...
...
kattunga
 
Posts: 83
Joined: 01 Oct 2013 19:03

by Jorge Sousa » 01 Oct 2014 15:00

Hi

Is a very good suggestion, we're going to implement as soon as possible.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to JQDatePicker

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.