Jump to content

Unigui Mobile ClientEvents.ExtEvents.Values['tap'] have bugs?


huayan889

Recommended Posts

Debugging found unisession. Addjs ('alert ((document. Getelementsbyname ("'+ user_ Password. Jsname + ') [0]. Value))) <> fpkey

the code used is as follows:

procedure TUnimLoginForm1.UniButton1Click(Sender: TObject);
var
  FpKey: string;
begin
  UniSession.AddJS( 'alert((document.getElementsByName("' + user_password.JSName +'")[0].value))');
  FpKey:=user_password.text;
  //Debugging found unisession. Addjs ('alert ((document. Getelementsbyname ("'+ user_ Password. Jsname + ') [0]. Value)))   Displayed value and FpKey:=user_password.text Obtained values are not the same
end;

procedure TUnimLoginForm1.UnimLoginFormCreate(Sender: TObject);
var
  ns, dwid: string;
begin
  UniButton1.ClientEvents.ExtEvents.Values['tap'] :=
  'function tap(sender, e, eOpts)' +
  '{'+
  '  document.getElementsByName("' + user_password.JSName+'")[0].value = MD5(document.getElementsByName("' +
  user_password.JSName +'")[0].value);'+
  '}';
end;

Link to comment
Share on other sites

5 hours ago, Sherzod said:

Hello, 

Can you please clarify your question again? What's problem? 

Debugging found unisession. Addjs ('alert ((document. Getelementsbyname ("'+ user_ Password. Jsname + ') [0]. Value)))   Displayed value and FpKey:=user_password.text Obtained values are not the same

Link to comment
Share on other sites

5 hours ago, huayan889 said:

The result of PC is what I want.

Hello,

Try this code:

procedure TMainmForm.UnimFormCreate(Sender: TObject);
begin
  //UnimButton1.ClientEvents.ExtEvents.Values['tap'] :=
  //'function tap(sender, e, eOpts)' +
  //'{'+
  //'  document.getElementsByName("' + uniMEdit1.JSName+'")[0].value = MD5 (document.getElementsByName("' +
  //uniMEdit1.JSName +'")[0].value);'+
  //'}';
  
  UnimButton1.JSInterface.JSAddListener('tap', 'function(){'+ UnimEdit1.JSName +'.setValue(MD5('+ UnimEdit1.JSName +'.getValue()))}');
end;

 

  • Like 1
Link to comment
Share on other sites

18 minutes ago, Sherzod said:

Hello,

Try this code:


procedure TMainmForm.UnimFormCreate(Sender: TObject);
begin
  //UnimButton1.ClientEvents.ExtEvents.Values['tap'] :=
  //'function tap(sender, e, eOpts)' +
  //'{'+
  //'  document.getElementsByName("' + uniMEdit1.JSName+'")[0].value = MD5 (document.getElementsByName("' +
  //uniMEdit1.JSName +'")[0].value);'+
  //'}';
  
  UnimButton1.JSInterface.JSAddListener('tap', 'function(){'+ UnimEdit1.JSName +'.setValue(MD5('+ UnimEdit1.JSName +'.getValue()))}');
end;

 

thank Sherzod,That's what I want.

Link to comment
Share on other sites

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...