Jump to content

Formatted input for uniEdit


zilav
 Share

Recommended Posts

A simple demo of using jquery plugins to format UniEdit control.

 

Masked Input for fixed length input

Include jquery.min.js and jquery.maskedinput-1.3.min.js in ServerModule.CustomFiles

 

maskInput for variable length input and regexp pattern matching

Include jquery.min.js and jquery.numberMask.js in ServerModule.CustomFiles

 

When UniEdit is on UniForm use Form.OnActivate event

When UniEdit is on UniFrame use UniTimer with RunOnce=true

 

Have fun!

post-12-0-35870200-1328897235_thumb.png

UniEditFormatDemo.zip

  • Upvote 3
Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 2 weeks later...
  • 2 weeks later...
  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 2 months later...

Simple way to use Formatted Input Mask in 0.9x and 0.8x biggrin.gif

 

Open the attached project, read instructions in example.

 

Long live to UniGui.. I love it!!!

 

attachicon.gifPrjMaskEdit.rar

 

Nelz

 

By using a mask with a date field in the database of type date, how to handle the error:

 

"__ / __ / ____" is not a valid date

 

in OnExit if the field is empty?

Link to comment
Share on other sites

  • 1 month later...

correct original project(ok for 9x version of unigui)

 

correct procedure TMaskedInput.Format(UniEditControl: TUniEdit);
var
  i: integer;
  js: string;
begin
  js := '';
  for i := 0 to definitions.Count-1 do
    js := js + SysUtils.Format('$.mask.definitions[''%s'']=''[%s]'';', [definitions.Names, definitions.ValueFromIndex]);
 js := js + SysUtils.Format('$("#%s_id-inputEl").mask("%s");', [uniEditControl.JSName, mask]);
 // js := js + SysUtils.Format('jQuery(function(){jQuery("#%s_id-inputEl").mask("%s");});', [uniEditControl.JSName, mask]);
  UniSession.AddJS(js);
 // UniSession.AddJS(Format('jQuery(function(){jQuery("#%s_id-inputEl").mask("%s");});', [Ed.JSName, MaskStr]));
end;
 

Link to comment
Share on other sites

  • 1 year later...
  • 7 months later...

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.

 Share

×
×
  • Create New...