Jump to content

Recommended Posts

Posted
Hi 
I do not want to be the server's operating 
Such as:
if UniEdit7.Text = 'شماره همراه' then
  begin
    UniEdit7.Clear;
    UniEdit7.Font.Color:=clBlack;
  end;

Since the server-side code will be reviewed and implemented in time

 

  • 4 weeks later...
Posted

Hi, in the form and the components exist:

Propierties

                 clientevents... event

                 UniEvents  .. event

Events

                on ajaxEvent

 

See unigui demos: ClientEvents-2 open  panel.clientEvents.mousedown  (near end of the list)

  • Upvote 1
Posted

its dosent work again

if EventName = 'myAjaxEvent' then
  begin
    if UniEdit2.Text = 'نام کاربری' then
    begin
      UniEdit2.Text := '';
      UniEdit2.Font.Color := clBlack;
    end;
  end;
not exist ,exit event 
please give me a guide
  • Administrators
Posted

 

its dosent work again

if EventName = 'myAjaxEvent' then
  begin
    if UniEdit2.Text = 'نام کاربری' then
    begin
      UniEdit2.Text := '';
      UniEdit2.Font.Color := clBlack;
    end;
  end;
not exist ,exit event 
please give me a guide

 

 

It is Delphi code.

You need to write an event handler in Java script.

  • Administrators
Posted

Hi hamze.

 

Can you clarify?

You want to perform this check on the client side?

 

 

Best regards.

 

I think he wants to convert below code to client side equivalent. Can you help on this? Thanks

if EventName = 'myAjaxEvent' then
  begin
    if UniEdit2.Text = 'نام کاربری' then
    begin
      UniEdit2.Text := '';
      UniEdit2.Font.Color := clBlack;
    end;
  end;
Posted

Hi,

From your example, I think that you want to use an "empty text",

If so for this you can do the following:

procedure TMainForm.UniEdit1Click(Sender: TObject);
begin
  //if UniEdit1.Text = 'نام کاربری' then
  //begin
  //  UniEdit1.Clear;
  //  UniEdit1.Font.Color := clBlack;
  //  UniEdit1.Font.Color := clWindowText
  //end; 
end;

procedure TMainForm.UniEdit1Exit(Sender: TObject);
begin
  //if UniEdit1.Text = '' then
  //begin
  //  UniEdit1.Text := 'نام کاربری';
  //  UniEdit1.Font.Color := clInactiveCaption;
  //end;
end;

UniEdit1.Font.Color := clWindowText

 

1. Use the property:

UniEdit1.EmptyText: = "نام کاربری"

Or

 

2. In DesignTime:

post-906-0-98061700-1416245206_thumb.png

 

Or

 

3. 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniEdit1.ClientEvents.UniEvents.Values['beforeInit'] := 'function(sender, config){sender.emptyText = "نام کاربری";}';
end;

Best regards.

  • Upvote 2

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.

×
×
  • Create New...