Jump to content

Get full path with JS from form file type


onlyican

Recommended Posts

Hey all

 

I have a form which allows a user to upload an image

I want to create a preview of what the page they are creating looks like, so I want to show a preview of the image on the page without uploading the image

 

So what I need to do is get the full path (The actual value shown in the form) to javascript

 

I done the following

 

//JavaScript bit
ShowTempImage(FormImgVal){
alert ("Val is "+FormImgVal);
}

//HTM Bit
<form method='post' action='' enctype='multipart/form-data'>
<input type='file' name='UploadImg' id='UploadImg' onclick='ShowTempImage(this.value);' />
</form>

 

And i get an alert saying the filename only, not the full path.

 

Anyone know How i can get the full path without page reload

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.