MORE form insanity

View: New views
3 Messages — Rating Filter:   Alert me  

MORE form insanity

by Timothy Laureska :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello:
Thanks to those that pointed out the missing SELECTED on the last question, but here's a another mystery to me :
 
I  have this select statement:
 
<select name="unit_id_other" multiple>
<foutput query="list_units">
<option value="#unit_id#">#unit_name#
</cfoutput>
</select>
 
going to this processing output template query:
 
<cfquery datasource="#datasource#" name="find_other_unit">
SELECT * FROM dhmh_units
where unit_id IN (#form.unit_id_other#)
</cfquery>

<cfoutput query="find_other_unit">#unit_id_other#,</cfoutput>
 
Which yields duplicate data For example, when I just select two items from the dropdown box, I get this output:  26,20, 26, 20  
 
Output of the form variable by itself is a single set of data:  26, 20
 
Any assistance would be appreciated
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328068
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4

RE: MORE form insanity

by lists-146 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


You'll get fewer unexpected results if your HTML is valid.

1) Close your option tags. This isn't 1997.
2) all attributes must have values:
        multiple="multiple"
        http://webdesign.about.com/od/htmltags/p/blatmultiple.htm

I might guess that the reason you're having dupe outputs is that your query
column name is the same as your FORM name. Possibly the values are
outputting from both values since you're not scoping your var in the output.

Dump both the query, and the FORM scope and see what you get.

-----Original Message-----
From: Timothy Laureska [mailto:TLaureska@...]
Sent: Thursday, November 05, 2009 8:20 AM
To: cf-talk
Subject: MORE form insanity


Hello:
Thanks to those that pointed out the missing SELECTED on the last question,
but here's a another mystery to me :
 
I  have this select statement:
 
<select name="unit_id_other" multiple>
<foutput query="list_units">
<option value="#unit_id#">#unit_name#
</cfoutput>
</select>
 
going to this processing output template query:
 
<cfquery datasource="#datasource#" name="find_other_unit"> SELECT * FROM
dhmh_units where unit_id IN (#form.unit_id_other#) </cfquery>

<cfoutput query="find_other_unit">#unit_id_other#,</cfoutput>
 
Which yields duplicate data For example, when I just select two items from
the dropdown box, I get this output:  26,20, 26, 20  
 
Output of the form variable by itself is a single set of data:  26, 20
 
Any assistance would be appreciated
 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328071
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4

RE: MORE form insanity

by Jason Durham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Is the CF/HTML you're posting really cut/pasted from the actual templates?  It appears not because you're missing a C in <cfoutput query="list_units">.

As others have said... get the Firefox Web Developer toolbar and validate your HTML frequently.  You're violating at least 3 "best practices" in the code you've provided (SELECT *, no cfqueryparam and malformed HTML).

-----Original Message-----
From: Andy Matthews [mailto:lists@...]
Sent: Thursday, November 05, 2009 8:40 AM
To: cf-talk
Subject: RE: MORE form insanity


You'll get fewer unexpected results if your HTML is valid.

1) Close your option tags. This isn't 1997.
2) all attributes must have values:
        multiple="multiple"
        http://webdesign.about.com/od/htmltags/p/blatmultiple.htm

I might guess that the reason you're having dupe outputs is that your query
column name is the same as your FORM name. Possibly the values are
outputting from both values since you're not scoping your var in the output.

Dump both the query, and the FORM scope and see what you get.

-----Original Message-----
From: Timothy Laureska [mailto:TLaureska@...]
Sent: Thursday, November 05, 2009 8:20 AM
To: cf-talk
Subject: MORE form insanity


Hello:
Thanks to those that pointed out the missing SELECTED on the last question,
but here's a another mystery to me :

I  have this select statement:

<select name="unit_id_other" multiple>
<foutput query="list_units">
<option value="#unit_id#">#unit_name#
</cfoutput>
</select>

going to this processing output template query:

<cfquery datasource="#datasource#" name="find_other_unit"> SELECT * FROM
dhmh_units where unit_id IN (#form.unit_id_other#) </cfquery>

<cfoutput query="find_other_unit">#unit_id_other#,</cfoutput>

Which yields duplicate data For example, when I just select two items from
the dropdown box, I get this output:  26,20, 26, 20

Output of the form variable by itself is a single set of data:  26, 20

Any assistance would be appreciated







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328074
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.4