Solved

select boxes

Posted on 2000-03-24
2
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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 …
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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