Solved

select boxes

Posted on 2000-03-24
2
194 Views
Last Modified: 2013-12-24
I am having a problem using a select box.
I have several select boxes or list boxes (vb) on my form which list data from tables.
How do I set the select box so that a user has the option to enter or in the best case delete  a value from the box which is set to a default value of my first item in the list.
Is this possible or has this been set up this way for referential integrity??
Should I be using a cfselect rather than a select??

0
Comment
Question by:acampoma
2 Comments
 
LVL 1

Accepted Solution

by:
fallon12345 earned 50 total points
ID: 2655144
The best way, IMO, is to append a none to the list.

ie.
select company_name,company_number
from company
union
select "None",-1 from comapany

Then use this query to populate your list box.
This will add a none option to the list box.

Then in your page that writes the record:

<cfif complist NEQ "-1">
<cfset company_number=#complist#>
<cfelse>
<cfset company_number=null>
</cfif>

Insert into contact (fname,lname,company_number)
values
('#fname#','#lname#',#company_number#)
0
 
LVL 6

Author Comment

by:acampoma
ID: 2655413
Great thanks alot!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question