huayan889 Posted May 4, 2021 Share Posted May 4, 2021 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; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 4, 2021 Share Posted May 4, 2021 Hello, Can you please clarify your question again? What's problem? Quote Link to comment Share on other sites More sharing options...
huayan889 Posted May 4, 2021 Author Share Posted May 4, 2021 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 Quote Link to comment Share on other sites More sharing options...
huayan889 Posted May 4, 2021 Author Share Posted May 4, 2021 Mobile: Tap UnimButton1: PC: Click unibuuton1: UniGUI Test Demo.rar Quote Link to comment Share on other sites More sharing options...
huayan889 Posted May 4, 2021 Author Share Posted May 4, 2021 The result of PC is what I want. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2021 Share Posted May 5, 2021 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; 1 Quote Link to comment Share on other sites More sharing options...
huayan889 Posted May 5, 2021 Author Share Posted May 5, 2021 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.