1
Below is an excerpt of the code. I have doubts about how to make, when clicking SEARCH, the CNPJ is found on the site receitasws and the fields below are filled: http://www.receitaws.com.br/v1/cnpj/00000000000000 using the $.ajax function of the jQuery library.
(Where "00000000000000" is the CNPJ to be researched)
<!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>
Where are the rest of the courses @Diego Marques
– Douglas Farias