Wednesday, December 31, 2008

[jQuery] How do I delete the content of a cloned filefield?

Hi, all... and Happy New Year (a little early. US East Coast, 8pm)!

I'm cloning a filefield, and, we'll assume, the user has already
used the browse button to locate a file.

When this filefield is cloned, the file path from the previous field
is still in the new field. I want to empty the filefield.

I tried this:

$('.image-next :last').attr('value', function() {
return this.value.replace("");

(The image filefields have the clas "image-next")

But that didn't work...no errors, but content was still in the field.

Suggestions?

Thanks,

Rick

No comments: