logo

New Response

« Return to the main article

You are replying to:

    • avatar
    • tt
    • Posted on Mon 11 Jul 2011

    Hey, Jake! Thanks for the info! I'm using this to be able to attach two images to be shown in two different areas of a page. I'm using a couple of hidden fields to do it, as well as a pile of javascript. I have a little problem, though. I entered validation to make sure that the image is the proper format (i.e. "gif" or "jpg"), and not too big (200x200). I am only missing ONE thing! I can't seem to clear the upload value (i.e. set it to ""). I've tried several different ways. The following little "for" loop should clear all the values from the uploads, bit it doesn't:

    for(var i = 0; i < f.elements.length; i++) { if( f.elements[i].type=='file' ){ f.elements[i].value = ""; } } }

    What's odd is that if I try

    alert( f.elements[i].value

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: