Saturday 15 May 2010

jquery - Why I can't serialize form with article tags inside? -


When I want to serialize my form, do not return any data and I do not know if my article is inside my form The reason is the reason for this problem.

HTML & lt; Form id = "question" & gt; & Lt; Article ID = "Uno" class = "question" & gt; & Lt; H2 & gt; 1. Elementos Controller A Sinkalo & lt; / H2 & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question1" value = "rc 1-p1-a" id = "answer 1_0" & gt; Bcle y acumulador & lt; / Labels & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 1" value = "rc 1-p1-b" id = "answer 1_1" & gt; Ciclo and Contador & lt; / Labels & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 1" value = "rc 1-p1-c" id = "answer1_2" & gt; Contador y condiciƃ³n & lt; / Labels & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 1" value = "rc 1-p1-d" id = "answer1_3" & gt; Candisson you aptador & lt; / Labels & gt; & Lt; / P & gt; & Lt; / Article & gt; & Lt; Article id = "dos" class = "question" & gt; & Lt; H2 & gt; 2. Elementos Controller A Sinkalo & lt; / H2 & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 2" value = "rc 1-p2-a" id = "answer2_0" & gt; Bcle y acumulador & lt; / Labels & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 2" value = "rc 1-p2-b" id = "answer 2_1" & gt; Ciclo and Contador & lt; / Labels & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 2" value = "rc1-p2-c" id = "answer2_2" & gt; Contador y condiciƃ³n & lt; / Labels & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label & gt; & Lt; Input type = "radio" name = "question 2" value = "rc 1-p2-d" id = "answer2_3" & gt; Candisson you aptador & lt; / Labels & gt; & Lt; / P & gt; & Lt; / Article & gt; & Lt; Article class = "question" & gt; & Lt; Input id = "sendAnswers" class = "btn-send" type = "submit" value = "envir" /> & Lt; Ul class = "error" & gt; & Lt; / Ul & gt; & Lt; / Article & gt; & Lt; / Form & gt;

I have that structure because I have a form slider.

Then, when I do this:

  console.log ($ ('# question') serializeArray ()).   

or

  console.log ($ ('# question'). Serialize ());   

Do not display data in the console.

None of the problem radio buttons are selected, it is sorting the form but serializing There is no value to do

Choose an option. Console. Try Apply

I added a full text box and selected radio in Bella to display it for work

  $ ("# sendAnswers"). Click (function () {console.log ($ ('# question'). SerializeArray ());});   

This also works

  $ ("# sendAnswers"). Click (function () {console.log ($ ('# questions'). Sort ());});   



No comments:

Post a Comment