Saturday, 17 August 2013

Append Form And Elements jQuery Mobile

Append Form And Elements jQuery Mobile

Hello I want to append a form and checkbox elements, but the form is
losing its style. The checkboxes should be combined in "list" and the
button Save Attendance should be styled according to jquery Mobile.
How can I fix this please?
This is how it looks:

Code:
$('#editattendancecontent').append('<p>Who Attended?</p><form
id="editattendanceform"><div data-role="fieldcontain"><fieldset
data-role="controlgroup" id="editattendancelist"></fieldset></div><input
type="submit" value="Save Attendance" data-inline="true" /></form>');
for (var i = 0; i < json.length; i++)
{
$('#editattendancelist').append('<input type="checkbox" id=\"' +
json[i].userID + '\" class="custom" /><label for=\"' + json[i].userID
+ '\">'+json[i].name+'</label>').trigger('create');
}
$('input: checkbox').checkboxradio("refresh");

No comments:

Post a Comment