O'Reilly logo

jQuery 1.3 with PHP by Kae Verens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moving directories

For moving, you need to provide a destination directory. To do this, this example will add a second directory-selector box when the move action is selected.

Client-side code

We will describe the JavaScript side of this function before writing the PHP.

First, replace the $(document).ready function in the file_manager.js file with this:

$(document).ready(function(){
fm_getFiles();
$('select[name="selected_file"]').change(function(){
fm_getFiles();
});
$('<select id="selected_file_options"></select>')
.insertAfter($('select[name="selected_file"]'))
.change(fm_runAction);
$('<span id="selected_file_extras"></span>')
.insertAfter($('#selected_file_options'));
});

Note that we've changed the way the fm_getFiles function is called. In ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required