Hi,
I have 3 basic components: A button called ‘Load’, a div called ‘articles’ and a textarea called ‘Editor’.
I want to be able to push the button which will populate the div with available files (this presently works) and then I want to select a file from the div filelist, get it’s contents from the server and put it in the test area (having trouble with this).
I presently have this:
jQuery Code:
$('#load').click(function() {
//alert ("Clicked!!");
$("#headlinearticles").load("ajax/filelist.php");
return false;
});
The server side code:
$output = "";
if ($handle = opendir($dir)) {
while (($file = readdir($handle)) !== false) {
if (is_file($file)) {
$info = pathinfo($file);
$fileName = basename($file, '.'.$info);
$output .= "".$fileName."
";
}
}
} else {
$output .= "Can not open directory";
}
echo $output;
What needs to be done so that I can select a file in the div (that’s been dynamically generated) to fill the Editor?
Thanks,
Kevin