How to reset a container field to a blank?

Archived from the Xataface Users forum.

sgallagher — Thu Aug 23, 2007 4:50 pm

Hi,
I have some container fields on my site that are working well (as references to files placed on the system), except, for example if I upload a file and then want to blank the entry at a later date, how do I give the user the option to blank the container field? If they leave the “Browse” entry blank, it doesn’t affect the data.

My fields.ini looks a bit like this..

[podcast_filename]
Type = container
widget:type = file
widget:label = “Podcast”
url = /podcasts
allowed_extensions = mp3
max_size = 20480

Thanks!


shannah — Thu Aug 23, 2007 5:20 pm

Sorry. No support yet for resetting container or blob fields. Perhaps in the next version.

-Steve


sgallagher — Fri Aug 24, 2007 3:03 am

Ok, thanks


dbaron2 — Wed Oct 07, 2009 11:05 pm

Has there been an update on this issue?

I just ran into the same problem.

It appears that the problem exists only for Firefox and Chrome. IE, K-Meleon, SeaMonkey and Opera allow you to edit and clear the field with the file name.


shannah — Thu Oct 08, 2009 7:14 am

This was added a couple releases ago. On the edit form, there is now a red ‘X’ next to any container field. Clicking on this will delete the current file (i.e. blank the container field).


dbaron2 — Thu Oct 08, 2009 8:06 pm

Yes and that works well for after the record is saved. But what if the user has not saved the record yet? The user cannot get to the field to space it out since when the user clicks on the field the open file dialog box is displayed. It is interesting that both Firefox and Chrome behave this way. IE, Opera, K-Meleon and SeaMonkey let the user edit the field. Perhaps I need to look for a Firefox setting that would control this.


shannah — Fri Oct 09, 2009 7:30 am

Oh.. i see. Best suggestion is to have them save the record. Then clear out the upload.