TWebMaskEdit not working

using TWebMaskEdit in a web core form seems to work ok. there still are some keystrokes that don't work quite right - like the backspace key. but overall you can enter and read the data. when I have the field linked to an input field in an html template, it stops working and behaves like it was reported in previous posts.

I am using Web Core ver 2.0.2.3 with Sydney 10.4 Update 2.

Am i missing some setting or not linking to the proper html field?

thanks,
Elias

I assume you link to a HTML INPUT element?
Is there anything specific to this HTML INPUT element? I retested this here with:

<input type="edit" id="edt"></input>

but could not see a problem with some test masks , like a numeric mask.

Thanks Bruno.

I had type="text" for the html element. It marginally works once I changed it to type="edit". It accepts the correct keystrokes and provides the correct EditText value. But the arrow, backspace and delete keys do not work. It will delete the text if I select it with the mouse then press backspace or delete key. I believe I saw the same behavior when the maskedit was not tied to an html element.

Elias

Hi Bruno I did that and it didn't work. Backspace still do nothing. I need to use Backspace and Enter in a mask edit or make a regular WebEdit to accept just numbers.

Not sure what you expect for Enter as the Enter key is not accepted in a single line edit.
We fixed an issue with Backspace. This fix will be in the next release.

I could not get the WebMaskEdit controls to work quite like I wanted. Maybe they are fixed by now, but I found it easier to add a KeyPress and a OnChange events to a WedEdit control. Here is my code for Social Security Num edit:

procedure TFViewSearch.edtSSNKeyPress(Sender: TObject; var Key: Char);
begin
if not (Key in ['0'..'9'] + ['-']) then
Key := #0;
end;

procedure TFViewSearch.edtSSNChange(Sender: TObject);
var
editText: string;
formattedText: string;
begin
editText := edtSSN.Text;
if Length(editText) < 4 then
Exit;
editText := StringReplace( edtSSN.Text, '-', '', [rfReplaceAll] );
if Length(editText) > 5 then
begin
formattedText := editText;
System.Insert( '-', formattedText, 6 );
System.Insert( '-', formattedText, 4 );
edtSSN.Text := formattedText;
end
else if Length(editText) > 3 then
begin
formattedText := editText;
System.Insert( '-', formattedText, 4 );
edtSSN.Text := formattedText;
end;
end;

Elias

Actually the problem is with Backspace. Enter is just tu accept but I solved it with onKeyPress.
You know that you can set the same TabOrder value in several components. That's why the initial focus doesn't work as expected. You can try it in the multiform example.

We fixed the Backspace issue.
For TabOrder, it is expected to set these to unique values at design-time if you want to use this.