Jump to content
Alisson

Insert text value into form with webbrowser android Delphi FMX with function WEBBROWSER.EvaluateJavaScript

Recommended Posts

I use TWEBBROWSER to insert data into a form .  

Application Delphi FMX Android. 

element type text not insert value string.

 

HTML Page: 

<input type="text" name="txtCPF" id="txtCPF" size="18" maxlength="14" autofocus="" title="Informe os onze dígitos do número do CPF." onkeypress="javascript: return EntradaNumerico(event);" onfocus="javascript: RemoveMask('txtCPF');" onblur="javascript: FG_FormatarCPF('txtCPF');" autocomplete="off" value="">

 

I need insert into element 'TXTCPF' the value type string  '02403989987' but if use the:

 

wbConsultaCPF:TWebBrowser;

 

wbConsultaCPF.EvaluateJavaScript('document.getElementById("txtCPF").value = "012345";');

Browser show just '012345' in white screen. In IOS Application, code works correctly.

 

if use :

wbConsultaCPF.EvaluateJavaScript('document.getElementById("txtCPF").value = 012345;');

 

browser show correct text in element value but cut the first zero.    '12345'. 

 

 

wbConsultaCPF.URL := 'https://servicos.receita.fazenda.gov.br/servicos/cpf/consultasituacao/ConsultaPublica.asp';

 

 

 

Edited by Alisson

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×