logo

New Response

« Return to the main article

You are replying to:

    • avatar
    • Steve
    • Posted on Wed 23 Apr 2003

    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);

    after the "if", the proper value pops up!

    Is there another way? I tried naming the IDs, (i.e. f.elements["Logo"].value = "";) but that didn't work either. Any help would be great.

    Thanks, ahead of time!

    Steve in Montreal =8P

Your Comments

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