The forum operates in read-only mode. Please head to StackOverflow for support.
var fileName = fileUrl.replace( /^.*[\/\\]/g, '' ) ;
Wiktor Walc CTO, CKSource - http://cksource.com -- Follow CKEditor on: Twitter | Facebook | Google+
function SetFileField( fileUrl, data ) { document.getElementById( data["selectFunctionData"] ).value = fileUrl ; }
function SetFileField( fileUrl, data ) { var fileName = fileUrl.replace( /^.*[\/\\]/g, '' ) ; document.getElementById( data["selectFunctionData"] ).value = fileName ; }
Re: SetFileField with no path - image name only
Re: SetFileField with no path - image name only
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: SetFileField with no path - image name only
For those interested, this code goes in the JavaScript within the page that your form is on (as opposed to in any of the more global .js files).
The original function:
function SetFileField( fileUrl, data ) { document.getElementById( data["selectFunctionData"] ).value = fileUrl ; }Becomes:
function SetFileField( fileUrl, data ) { var fileName = fileUrl.replace( /^.*[\/\\]/g, '' ) ; document.getElementById( data["selectFunctionData"] ).value = fileName ; }