Jump to content

Preview local images


DarkendSoul

Recommended Posts

Currently im using the following script in an attemp to preview local images before submitting them but it doesnt change...

[code]
        <tr><td class="text">Image:</td>
            <td><img id="icon" class="world">
                <input type="hidden" name="MAX_FILE_SIZE" value="5000" /><input type="file" name="char_pic" size="15" class="char_pic" onclick="icon.src = 'file:///' + this.value" /></td></tr>
[/code]

does anyone know why? the file exists...
Link to comment
Share on other sites

hey, cool. it works.

problem is the onClick. Clicking the button opens the browse window while the javascript attempts to load an unselected image to the image source. After you select a picture, click it again and the image pops right up.

maybe onclick isn't the right way to do this? maybe a <body onFocus> or something?
Link to comment
Share on other sites

[code=php:0]var my_var = setInterval("somefunction",5000);[/code]

That would fire the function every five seconds.

http://developer.mozilla.org/en/docs/DOM:window.setInterval
http://developer.mozilla.org/en/docs/DOM:window.clearInterval

[b]PS>[/b] it is case sensitive and firefox is very very case sensitive. Also, the quotes aren't listed in the manuel, however, I found that firefox wouldn't work without quoting the function to call.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.