Solved

select boxes

Posted on 2000-03-24
2
160 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now