For the question let me simplify my code:
I have two html forms with id's of 'header' and 'existing'
In the 'existing' form I have a select element where the options list is loaded dynamically using Ajax depending on the result of a search - this works fine with the following jQuery:
$(document).ready(function() {
$('#article').keyup(function() {
var getData = 'q=' + this.value + '&s=' + $('#supplierCode').val();
$.getJSON('article.php', getData, function(j) {
var options = '';
for (var i = 0; i < j.length; i++) {
options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
}
$('select#articleList').html(options);
});
return false;
});
});
The search works and the list appears to be loaded correctly as part of the form. I then want the input data of this form to be combined with the data of the 'header' form before submitting. I use this jQuery:
$(document).ready(function() {
$('#articleList').change(function() {
$('#existing :input').not(':submit').clone().hide().appendTo('#header');
$('#header').submit();
});
});
But whatever I select from the options list the $_REQUEST data always shows the first item on the list as chosen.
I can add more code if this is necessary - but hopefully the esence of the problem is clear!
$_REQUEST? Are you talking php by any chance?