0
Good people I am new to Javascript, and I need to save the value of the matricule field in a variable and pass it in the URL of a getJson. How can I do that? Follow the code below the two functions: Code to save the registration variable:
$(function($){
$('#btn_entrar').click(function(){
var matricula = $('#id_matricula').val();
});
);
Code to call my getJson:
$("#btn_entrar").click(function(event){
$(document).ready(function(){
$.getJSON("URL/'ValorDaVariavelMatricula'", function(data){
});
});
});
Because you have two events click to the same button
#btn_entrar
? Has to join together both.– DontVoteMeDown