I am having some issues. Maybe its my understanding.
I have a few TWebEdits with the html having a default placeholder.
I then use Delphi to change Hint and TextHint.
- Hint changes the first time I set it - it reflects in the title attribute.
- Hint doesnt change the second time I change it.
- TextHint never updates the placeholder. The original html's placeholder is visible.
Fragment of the form below, I need to change the placeholder and title whenever the "radio buttons" is pressed.
The code is
procedure TCoordinate_Validator.Set_Coordinate_Format
(AFormat : TCoordinate_Format);
begin
FFormat := AFormat;
case FFormat of
cf_DD :
begin
if Assigned(Fedt_Lat)
then begin
Fedt_Lat.TextHint := '40.445';
Fedt_Lat.Hint := 'DD.DDD format (e.g., 40.445)';
end;
if Assigned(Fedt_Lng)
then begin
Fedt_Lng.TextHint := '-74.010';
Fedt_Lng.Hint := 'DD.DDD format (e.g., -74.010)';
end;
end;
cf_DDMM :
begin
if Assigned(Fedt_Lat)
then begin
Fedt_Lat.TextHint := '40 26.7';
Fedt_Lat.Hint := 'DD MM.M format (e.g., 40 26.7)';
end;
if Assigned(Fedt_Lng)
then begin
Fedt_Lng.TextHint := '-74 00.6';
Fedt_Lng.Hint := 'DD MM.M format (e.g., -74 00.6)';
end;
end;
cf_DDMMSS:
begin
if Assigned(Fedt_Lat)
then begin
Fedt_Lat.TextHint := '40 26 42';
Fedt_Lat.Hint := 'DD MM SS format (e.g., 40 26 42)';
end;
if Assigned(Fedt_Lng)
then begin
Fedt_Lng.TextHint := '-74 00 36';
Fedt_Lng.Hint := 'DD MM SS format (e.g., -74 00 36)';
end;
end;
end;
Clear_Existing_States;
Set_Format_Button_State(FFormat);
// Re-validate existing content with new format
if Assigned(Fedt_Lat) and (Trim(Fedt_Lat.Text) <> '')
then Validate_Coordinate(Fedt_Lat, 'lat');
if Assigned(Fedt_Lng) and (Trim(Fedt_Lng.Text) <> '')
then Validate_Coordinate(Fedt_Lng, 'lng');
end;
