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:
- <div class="questionItem" QUESTION_ID="7">
- 1. Overall, I was satisfied with my experience at Aroma Cafe.<br />
- <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>
- </div>
here is my code:
- <div data-options="dxView : { name: 'survey', title: 'Survey', disableCache: true } " >
- <div data-options="dxContent : { targetPlaceholder: 'content' } " class="dx-content-background">
- <div data-bind="dxScrollView: {}">
- <!-- <div data-bind="foreach: questions"></div> -->
- <div class="questionItem">
- You Name:
- <div id="txtName" data-bind="dxTextBox: { }"></div>
- </div>
- <div class="questionItem">
- Email Address:
- <div id="txtEmail" data-bind="dxTextBox: { }"></div>
- </div>
- <div class="questionItem">
- Birthday:
- <div id="dateBirthday" data-bind="dxDateBox: {}"></div>
- </div>
- <div class="questionItem">
- 1. Overall, I was satisfied with my experience at Aroma Cafe.<br />
- <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>
- </div>
- <div class="questionItem">
- 2. I am likely to recommend Aroma Cafe to a friend or colleague.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 3. Aroma Cafe offers good value for my money.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 4. Aroma Cafe has a good variety of choices.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 5. The staff were friendly at Aroma Cafe.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 6. The staff were knowledgeable about Aroma Cafe's offerings.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 7. My order tasted great.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 8. My order was served hot.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 9. My order was accurate and looked appealing.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 10. My order was on time.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 11. The look and feel of the outlet was clean and inviting.<br />
- <div data-bind="dxRadioGroup: { items: [ 'Strongly Agree', 'Agree', 'Neither Agree Nor Disagree', 'Disagree', 'Strongly Disagree' ], layout: 'vertical' }"></div>
- </div>
- <div class="questionItem">
- 12. Please share any other throughts or comments:
- <div data-bind="dxTextArea: { }"></div>
- </div>
- <div class="questionItem">
- <div data-bind="dxButton: { text: 'Submit' }"></div>
- </div>
- </div>
- </div>
- </div>
Thanks,
Jassim