Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TEdit Editing types
Tue, Jun 4 2013 5:15 AMPermanent Link

Uli Becker

Tim,

we discussed this earlier:

<<
Since there are a lot of numbers to be entered, it would be great, if
the software keyboard of the mobile phone would switch to numbers.
In HTML I can use
<input type="number" name="test" id="test" />
Is there a way to achieve the same with EWB (eventually by editing the js
code)? >>

Your answer was:

<< I've got a similar request for this already, so I'm going to look
into adding some editing types to the TEdit control for next build. >>
<<Yes, I'm going to include it in the next build.  It's just a matter of
changing how the edit element is created. >>

Since I don't see such a property: is that already implemented?

Thanks Uli

Tue, Jun 4 2013 6:20 AMPermanent Link

Matthew Jones

I too would like this, or a way to add such even if manually.

/Matthew Jones/
Tue, Jun 4 2013 2:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Since I don't see such a property: is that already implemented? >>

No, it got cut from 1.02 due to time.  It's on the list for the next round
along with other mobile improvements.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jun 5 2013 5:08 AMPermanent Link

Uli Becker

Matthew,

> I too would like this, or a way to add such even if manually.

this is the code Tim gave me:

<<
You can add a component for this
by sub-classing the TCustomEdit component in the WebCtrls unit:

type

   TNumberEdit = class(TCustomEdit)
      protected
         function CreateInputElement: THTMLInputElement; override;
      end;

implementation

function TNumberEdit.CreateInputElement: THTMLInputElement;
begin
   Result:=THTMLInputElement(CreateHTMLElement('input'));
   Result.type:='number';
end;

And you can create the edit control at runtime like this:

procedure TForm1.Button11Click(Sender: TObject);
var
   TempEdit: TNumberEdit;
begin
   TempEdit:=TNumberEdit.Create(Panel1);
   TempEdit.Top:=160;
   TempEdit.Left:=184;
   TempEdit.Height:=24;
   TempEdit.Width:=121;
end;

Be forewarned, the above probably won't work on some versions of IE, but
since you're doing a mobile site, that should be less of a concern.
>>

Uli


Thu, Jun 6 2013 5:07 AMPermanent Link

Matthew Jones

Thanks - another message to mark as a todo!

/Matthew Jones/
Image