I'm working with jQuery to register information in the database through Ajax and I'm not sure why this code is returning me an object type variable. The project I'm working on is being developed over a Admin Panel
with the entire interface and HTML, CSS e JS
ready. Here is the code:
$("#cadastra_produtos").submit(function(){
var prod_nome = $("#prod_nome");
var prod_categoria = $("#prod_categoria");
var prod_dimens = $("#prod_dimens");
var prod_qtde = $("#prod_qtde");
var prod_valor = $("#prod_valor");
var prod_descr = $("#prod_descr");
if(prod_nome) { alert(prod_nome); } <-- isso me retorna um objeto
The only particularity of this form that I think might be generating some type error is the chosen-select
plugin that is part of the system front end.
Can you help me figure out why the alert shows me an object, not the string?