Arghhh...... as Captain Jack Sparrow would say. Anybody from the daytime
crew wanna shot at this? I cannot seem to write a good enough <cfif>
statement to get this to insert properly.
If user does not fill in (asking1) and fills in (asking 2) then asking2 gets
inserted. If user fills in (asking1), asking1 gets inserted but not asking2
and so on. If user fills in neither asking1 or asking2 then default price
gets inserted (0) anyhow that is how it suppose to work, but does not!!
Just to make this easy for everybody to understand. Here is what is
happening.
<input type="radio" value="Firm"><input type="text" name="asking1" value="">
User enters price (firm price)
OR
<input type="radio" value="Negotiable"><input type="text" name="asking2"
value=""> User enters price (Negotiable price)
OR
<input type="radio" name="price_option" value="free">
<input type="radio" name="price_option" value="make_offer">
And the update query
<CFQUERY name="NewClassID" datasource="#APPLICATION.DB#"
username="#APPLICATION.UN#" password="#APPLICATION.PW#">
UPDATE #APPLICATION.DBPRE#Advertisements
SET CategoryID = #ARGUMENTS.CategoryID#,
SCategoryID = #ARGUMENTS.SCategoryID#,
title = '#ARGUMENTS.title#',
<!---HERE IS WHERE I AM STUCK--->
<cfif len(arguments.asking1) or len(arguments.asking2)>
<cfif len(arguments.asking1) AND not(Len(Arguments.asking2))>
price = #arguments.asking1#,
<cfelse>
<cfif not(len(arguments.asking1)) AND len(Arguments.asking2)>
price = #arguments.asking2#,
</cfif>
</cfif>
<cfelse>
price = 0,
</cfif>
</CFQUERY>
Doug B.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264887
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4