News

Log In Sponsors
Partner Sites

Re: upload image preview



Hi, I've tried this small script: [code:2qiub7mw] <!-- image preview --> <script language="javascript"> var imgRe = /^.+\.(jpg|jpeg|gif|png)$/i; function previewImage(pathField, previewName) { console.log(pathField.value); var path = pathField.value; if (path.search(imgRe) != -1) { document[previewName].src = 'file://'+path; console.log( 'file://'+path); } else { alert("JPG, PNG, and GIFs only!"); } } </script> [/code:2qiub7mw] but the var path contains only "picture1.png" instead of the complete path "User/Desktop/Picture1.png".

Click here to read the whole forum topic