0

i am in mobile app. I store in sqlite some student exams like this

classes...........student.......grade......................new grade

class 1...........name 1........previous exams.......

class 1...........name 2........previous exams.......

class 1...........name 3........previous exams.......

and i want to create a form like this

<label name1 - previous exams>  <INPUT FIELD NEW GRADE1>
<label name2 - previous exams>  <INPUT FIELD NEW GRADE2>
<label name3 - previous exams>  <INPUT FIELD NEW GRADE3>
 ....

submit button

how can i do this???

please advice

1 Answer 1

1

There are so many ways of doing this. Your best bet is to use JSON to tell your server-side script to create values that you want, then from your jquery code you can create the input list using code similar to this one:

$.getJSON('happyserver.php', function(data) {
var items = [];

$.each(data, function(key, val) {
items.push('<label id="' + key + '"><input id="' + val + '">');
 });

$('<div/>', {
'class': 'my-new-list',
 html: items.join('')
 }).appendTo('body');
});

You got the lingo! For further info, check jQuery API http://api.jquery.com/jQuery.getJSON/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.