Radio's ID and Value for a Survey

Radio's ID and Value for a Survey

Hi,

I have below code and I want to pus the info below to a .ajax to send it to my PHP but I want to have the ID of every question assign to it then my jquery send it because I want my database to save the question_id and the value for the radio group. something like this:

  1. <div class="questionItem" QUESTION_ID="7">
  2.     1. Overall, I was satisfied with my experience at Aroma Cafe.<br />
  3.     <div data-bind="dxRadioGroup: { items: [ {id: 1, name: 'Strongly Agree'}, {id: 2 , name: 'Agree'}, { id: 3, name: 'Neither Agree Nor Disagree'}, {id: 4, name: 'Disagree'},{id: 5, name: 'Strongly Disagree'}], displayExpr: 'name', valueExpr: 'id', layout: 'vertical', value: radioBoxGroupValue }"></div>
  4. </div>

here is my code:

  1. <div data-options="dxView : { name: 'survey', title: 'Survey', disableCache: true } " >
  2.     <div data-options="dxContent : { targetPlaceholder: 'content' } " class="dx-content-background">
  3.         <div data-bind="dxScrollView: {}">
  4.             <!-- <div data-bind="foreach: questions"></div> -->
  5.             <div class="questionItem">
  6.                 You Name:
  7.                 <div id="txtName" data-bind="dxTextBox: { }"></div>
  8.             </div>

  9.             <div class="questionItem">
  10.                 Email Address:
  11.                 <div id="txtEmail" data-bind="dxTextBox: { }"></div>
  12.             </div>

  13.             <div class="questionItem">
  14.                 Birthday:
  15.                 <div id="dateBirthday" data-bind="dxDateBox: {}"></div>
  16.             </div>

  17.             <div class="questionItem">
  18.                 1. Overall, I was satisfied with my experience at Aroma Cafe.<br />
  19.                 <div data-bind="dxRadioGroup: { items: [ {id: 1, name: 'Strongly Agree'}, {id: 2 , name: 'Agree'}, { id: 3, name: 'Neither Agree Nor Disagree'}, {id: 4, name: 'Disagree'},{id: 5, name: 'Strongly Disagree'}], displayExpr: 'name', valueExpr: 'id', layout: 'vertical', value: radioBoxGroupValue }"></div>
  20.             </div>

  21.             <div class="questionItem">
  22.                 2. I am likely to recommend Aroma Cafe to a friend or colleague.<br />
  23.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  24.             </div>

  25.             <div class="questionItem">
  26.                 3. Aroma Cafe offers good value for my money.<br />
  27.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  28.             </div>

  29.             <div class="questionItem">
  30.                 4. Aroma Cafe has a good variety of choices.<br />
  31.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  32.             </div>

  33.             <div class="questionItem">
  34.                 5. The staff were friendly at Aroma Cafe.<br />
  35.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  36.             </div>

  37.             <div class="questionItem">
  38.                 6. The staff were knowledgeable about Aroma Cafe's offerings.<br />
  39.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  40.             </div>

  41.             <div class="questionItem">
  42.                 7. My order tasted great.<br />
  43.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  44.             </div>

  45.             <div class="questionItem">
  46.                 8. My order was served hot.<br />
  47.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  48.             </div>

  49.             <div class="questionItem">
  50.                 9. My order was accurate and looked appealing.<br />
  51.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  52.             </div>

  53.             <div class="questionItem">
  54.                 10. My order was on time.<br />
  55.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  56.             </div>

  57.             <div class="questionItem">
  58.                 11. The look and feel of the outlet was clean and inviting.<br />
  59.                 <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
  60.             </div>

  61.             <div class="questionItem">
  62.                 12. Please share any other throughts or comments:
  63.                 <div data-bind="dxTextArea: { }"></div>
  64.             </div>

  65.             <div class="questionItem">
  66.                 <div data-bind="dxButton: { text: 'Submit' }"></div>
  67.             </div>
  68.         </div>
  69.     </div>
  70. </div>

Thanks,
Jassim