http://www.jynk.net/Adelphoi/main/admin/project_add.php
got a browse for file field but i haven't got the know how to remove the path!
can someone point me in the right direction?
function getme() { document.jonny.thefilename.value = document.jonny.filename_a.value;
document.jonny.submit(); }
[man]basename[/man]?
I'm not exactly sure what you're trying to do, but I'm guessing [man]basename[/man] will help.
edit: doh! Lordshryku beat me to it while I was looking on php.net to remember the name of that function.
i was trying to do this= function getme() { var frm = document.jonny; var str_filename = frm.filename_a.value; if(str_filename != ""){ last_pos = str_filename.lastIndexOf("/"); document.jonny.thefilename.value = str_filename.substring((last_pos+1),str_filename.length); } document.jonny.submit(); }
This is a php forum, not a javascript forum. If you're looking for a javascript solution, look on a javascript forum.