2
I need a light for something I’m doing.
within a form
there are several radios
and some text box
.
I need to get all the data inside one objeto jQuery
.
below an example of how I do containing only inputs
with checked
.
var dados = {"result":[]};
var objRadio = $('input:checked').each(function(){
dados.result.push({
"id_user" : idUser,
"id_varejo" : idvarejo,
"id_pesquisa" : idPesquisa,
"id_pergunta" : $(this).attr('name'),
"id_resposta" : $(this).val(),
"nome" : nome,
"id_status" : 7
});
});
and the return would be this :
I need the checks to return its value and the text box returns the text
I’d appreciate it if someone could shed some light
Could edit the question and put the return of
json
?– Rafael Augusto
Hi Rafael, the return would be a jquery object.
– Carlos Lopes
This I understood, I just would like you to pick up the return and put it here (without being image), so we can do the tests based on the return that Voce already has.
– Rafael Augusto
Hi Rafael, follow an example of the return. {"result":[{"id_user":"1","id_varejo":"2768","id_pesquisa":"3","id_pergunta":"7","id_resposta":"31","nome":"","id_status":7},{"id_user":"1","id_varejo":"2768","id_pesquisa":"3","id_pergunta":"9","id_resposta":"35","nome":"","id_status":7},{"id_user":"1","id_varejo":"2768","id_pesquisa":"3","id_pergunta":"11","id_resposta":"37","nome":"","id_status":7}]}
– Carlos Lopes
Can you post your working code? on
JSFiddle
or right here? includingHTML
andJS
– Rafael Augusto
It would be impossible because the project is giant :(
– Carlos Lopes
But you can’t just post that part?
– Rafael Augusto