I'm trying to do a function in jQuery that by clicking on the button it executes the click () function of jQuery to pick up input data and send via post
HTML
<input type="text" name="nome" class="input-xlarge" placeholder="Nome" required="required" />
<input type="email" name="email" class="input-xlarge" placeholder="Endereço de email" required="required" />
<input type="text" name="dominio" class="input-xlarge" placeholder="Domínio" required="required" />
<button type="submit" class="btn submit" id="submit">Criar uma conta</button>
jQuery
<script>
$(document).ready(function()
{
$("#submit").click(function()
{
var nome = $("input[name=nome]").val();
var email = $("input[name=email]").val();
var dominio = $("input[name=dominio]").val();
$.post('api.php', {nome:nome, email:email}, function(data)
{
alert(data);
})
})
})
</script>
An error appears in the browser console:
Uncaught ReferenceError: Datex is not defined preco.php: 29 (anonymous function) preco.php: 29 (anonymous function) preco.php: 30 Uncaught ReferenceError: _gaq is not defined global.js: 1 (anonymous function) global.js: 1 jquery.min.js: 2 p.fireWith jquery.min.js: 2 e.extend.ready jquery.min.js: 2 c.addEventListener.B