0
Good note.
I have a problem with the logic of how to proceed between a set of questions and answers. I have the code below formed by inputs with the types text and radio.I want to recover the information of these elements in the order they PRESENT themselves.The inputs are presented in the sequence question and answer.When the user finishes asking the questions and the answers I want the information is allocated in a vector where the questions were in odd indece and the answers in indece pair(Recital 1 as the first indece of the vector) AND CONSIDERING THE SEQUENCE OF THE DOCUMENT IE THE DATA OF THE FIRST QUESTION STAY IN THE INDECE 1 THE DATA OF THE ANSWER OF THE QUESTION 1 STAY IN THE INDECE 2 . THE DATA OF QUESTION 2 IS UNDECIDED 2 AND YOUR ANSWER IS UNDECIDED 3.(Values of selected radios)
<input type="text" class="pergunta">
<div><input type="radio" class="resposta" name="grupo1"
value="num1">numero 1</div>
<div><input type="radio" class="resposta" name="grupo1"
value="num2">nunero 2</div>
<div><input type="radio" class="resposta" name="grupo1"
value="num3">numero 3</div>
<input type="text" class="pergunta">
<input type="text" class="resposta">
<input type="text" class="pergunta">
<div><input type="radio" class="resposta" name="grupo2"
value="num1">numero 1</div>
<div><input type="radio" class="resposta" name="grupo2"
value="num2">nunero 2</div>
<div><input type="radio" class="resposta" name="grupo2"
value="num3">numero 3</div>
<input type="button" value='botao'id="botao">
I’m using the each function to take the data only it takes the data of a type first ex text and then takes the radio
'The answer data for question 1 is at index 2 and the answer data for question 2 is at index 2', what do you mean? can explain what you want in an objective and clear way?
– Felipe Duarte
And why your question stays on an input, and is probably an output value and not an input value?
– Leandro Angelo