I know how to fill a single INPUT field with an ajax call like this. Suppose this is GO.PHP:
$qry = mysql_query("SELECT * FROM reviews WHERE id = ".$_GET['param']." ");
while($review = mysql_fetch_array($qry)) {
echo $review['description'];
}
When I click the following:
<a class="editlink" id="<?php echo $review['id']; ?>" href="#"><?php echo $review['title']; ?></a>
I call ajax like this:
$(".editlink").click(function() {
$.get("go.php", {param: $(this).attr('id')},
function(data) {
$('textarea#area1').html(data);
});
return false;
});
'data' is filled by 'echo $review["description"]' and passed to TEXTAREA which is populated correctly. Ok, up to now everything works. But I don't know how to populate two, three, four, etc fields with the same mySQL query. Suppose I also had:
<input type="text" name="title">
<input type="text" name="date">
<input type="text" name="author">
How do I have to pass 'data' (GO.PHP) to populate all the INPUT fields?