[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Adding Null to Select Box using mv_metadata?
Quoting David Kelly (david@zeald.com):
> On Tue, 19 Nov 2002 10:46 am, Mike Heins wrote:
> > Quoting David Kelly (david@zeald.com):
> > > On Mon, 18 Nov 2002 8:31 pm, Rene Hertell wrote:
> > > > > I have a page that is using the table-editor tag to edit a number
> > > > > of fields in the database. One of the fields is using a Select Box
> > > > > to display a list of options that have been extracted from another
> > > > > table in the database (using mv_metadata). I need to add a NULL
> > > > > value to the select box so that on occasion the user can select a
> > > > > NULL value from the dropdown. Has anyone ever done this before?
> > > > > and if so could they point me to some docs, old mailing list/forum
> > > > > posts or anything else that might help me get this going?
> > > >
> > > > I think that the nullselect filter is what you are looking for...
> > >
> > > Yeah I was thinking that too ... but I gave it a try and no joy?
> > > Any other ideas?
> >
> > Are you *explicitly* trying to set a database NULL value? Hmm. IC's
> > update_data routine can't do that; and it is not common, for this is the
> > first time I have ever heard that desire.
>
> I am wanting to allow the user to select some data from a drop-down box for
> the field. But, occasionally the user doesn't want any data to be added to
> the field. Unfortnately by default the drop down has the first record in the
> drop down selected and so the first value in the drop down is entered is in
> the field. So the user is left with no way of adding NULL to the field.
>
> So essentailly my question is this. Is there anyway to add a NULL (or even an
> empty string ("")) value to the drop down list (and have it so that this is
> selected by default) using table-editor and mv_metadata in 4.8.6?
You had all confused me. You aren't talking about adding a NULL, but an
empty string. They are two different things in SQL.
I assume you are talking about combining the option for a blank with
some values that come from a lookup. If you add "=--none--" to the
options field in metadata that will do it.
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.513.523.7621 <mike@perusion.com>
Prove you aren't stupid. Say NO to Passport.