What is the simplest way to dynamically create a hidden input form field using jQuery?
$('<input>').attr('type','hidden').appendTo('form');
To answer your second question:
$('<input>').attr({
type: 'hidden',
id: 'foo',
name: 'bar'
}).appendTo('form');