|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
CFIF question regarding SELECT forms?
-----EDIT------
I have made a change, so you can read my latest post first if you like.. -----EDIT------ Hi, I have a field in my table called weightID. I created a new table called weights with 2 fields, weightID and weightvalue The weightID is an autonumber and weightvalue is either a No or a Yes, so there are only 2 rows total. 1=NO, 2=YES I have built a 1 to many relationship with Access for the weightID in my first table and the weightID in my weights table. I have a form, and I want to use a CFIF statement to determine whether a YES has been applied to the basket previously. If it hasn't, I want it to automatically select NO. The owner who maintains the baskets can determine which basket gets moved to YES. So I previously had a CFIF statement created, but its not doing what I want. Here is it Code:
<select name="weights"> <CFOUTPUT query="weights"><option value="#weightID#" <CFIF weights.weightID EQ "2">Selected</CFIF>>#weightvalue#</option></CFOUTPUT> </select> my sql at the top of the page is Code:
<CFQUERY name="weights" datasource="something"> SELECT weightID, weightvalue FROM weights </CFQUERY> WHenever I run the select option I have, if it is EQ 2, and I choose a INSERT NEW BASKET, which does not previously have a value, it gives me YES, and I don't want that. In a nutshell, if I go to create a new basket, it should automatically give the value of NO or 1 because nothing previously had been stated for it to have a YES. I have gone in my database and gave every basket a weightID of 1. Last edited by jag5311 : September 30th, 2003 at 03:38 PM. |
|
#2
|
|||
|
|||
|
Ok, this is what I have accomplished...
If a basketID is provided on the page, I tell the page to set the weightID=baskets.weightID (which is strictly for UPDATING THE PAGE) ELSE I tell it to set the value of weightID="1" so automatically, if its a new page, it sets it to NO. So far so good. Plus, the CFIF statement is working, I have tested it by applying a weightvalue of 2, too 3 baskets. When I went to the edit pages of those 3 baskets, it showed YES for the weightvalue. Problem is, when I go to NEW BASKET, i get an error saying weightID is undefined in BASKETS, which I have put in the if statement <CFIF baskets.weightID EQ..... So it doesn't like that for some odd reason. Any help? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CFIF question regarding SELECT forms? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|