Below is a snippet of code. I have doubts on how to do so, when clicking SEARCH, the CNPJ can be found on the receivers site and the fields below are filled in: link using the $ .ajax function of the jQuery library.
(Where "00000000000000" is the CNPJ to be searched for)
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>.:Formulario:.</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="estilo.css">
<script src="jquery.js"></script>
<script src="jquery.validate.js"></script>
<script>
/*$(document).ready(function(){
$.ajax({
url:'http://www.receitaws.com.br/v1/cnpj/[cnpj]',
method:'GET',
dataType:'jSon',
complete: function(xhr){
console.log(xhr.responseJSON);
}
});
}); */
/*{
"scriptkey": "DATABASE_PASSWORD",
"scriptvalue": "",
"scriptdefaultvalue": "",
"type": "password"
},*/
</script>
</head>
<body>
<form id="formu">
<p>Cadastro de Empresa</p>
<fieldset id="first">
<label for="cnpj">CNPJ</label><br/>
<input id="cnpj" type="text" name="cnpj" size="35" maxlength="14" style="margin-right:20px; ">
<input type="submit" name="pesqui" value="Pesquisar"><br/><br/>
<label for="razao">Razão social</label><br/>
<input id="razao" type="text" name="razao" size="35" maxlength="50"><br/><br/>
<label for="nome">Nome fantasia</label><br/>
<input id="nome" type="text" name="nome" size="35" maxlength="50"><br/><br/>
</fieldset>
<fieldset id="second">
<label for="logradouro">Logradouro</label><br/>
<input id="logradouro" type="text" name="Logradouro" size="35" maxlength="50"><br/><br/>
</fieldset>
<br/><input id=save type="submit" name="salvar" value="Salvar">
</form>
</body>
</html>