Sarfraz,
Submitting the form you created should send all the data back to the web server as POST data. However, if you are trying to retrieve this information via JavaScript, the look at the jQuery Library and examples for retrieving values from Radio Buttons, Check Boxes, and Text Fields.
If you need to interact with the user, turn on / off specific fields, then jQuery again will help you accomplish this, by setting up triggers. For example, when a user selects one of the Radio Buttons, the CheckBoxes become available. When a user selects a check box the text fields become available. And, if you just need to record which RadioButton, CheckBox, or TextField then the triggers will help you with that as well.
To send the right data back to your web server, you could use an AJAX call, or create additional Hidden Fields that contain the right information. In the first case, the AJAX call, you would need to create a POST data string that contains the information you want sent to the server. To call your AJAX function, you would capture the SUBMIT button's event.
Hope this helps guide you in the right direction.
Mike,
On 8/21/2013 1:29 PM, Sarfraz Ahmad wrote:
Hello guys...
I am working on a Quiz app where i have a bunch questions and a bunch of options for each question. for user input i have a bunch of of radio buttons, check boxes and text input fields related to each question. means a question can have 4 radio buttons for single choice question, 4 check boxes for multiple choice questions and text fields if user has to write the answer.Each of these check box, radio button or input element has two attributes question_id and answer_id. My problem is that i when a user click on the submit button i want to get the attribute of the fields the user selected so that i get to know the question id and answer id of the answer the user selected. Guys help me and tell me how can i do it using jQuery or javaScript
--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.