cfselect

This is a discussion on cfselect within the Cold Fusion forums in Application Servers & Tools category; I want to add new option where no option available in existing query. ex. In fruits, I have apple orange mango but so many missing. I want to add new those are not in query while have some in cfselect prefix....

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-28-2008, 02:53 AM
ysurati01
Guest
 
Default cfselect

I want to add new option where no option available in existing query.
ex. In fruits, I have apple orange mango but so many missing.
I want to add new those are not in query while have some in cfselect prefix.

Reply With Quote
  #2  
Old 08-28-2008, 02:07 PM
CF_output
Guest
 
Default Re: cfselect

you manually add the option...

But then your options will be out of order.

I would suggest updating your database/list/etc

<cfselect name="mySelect">
<option value="Blueberry">Blueberry</option>
<option value="Strawberry">Strawberry</option>
<cfoutput query="myQuery">
<option value="#fruit#">#fruit#</option>
</cfoutput>
</cfselect>

Reply With Quote
  #3  
Old 08-28-2008, 05:27 PM
fober1
Guest
 
Default Re: cfselect

Hi,
You have to combine a edit-field where customers can enter new values, and a
list-field with the existing values from the database.
When the page gets submitted, you just query if the submitted value in the
edit-field already exists in the db-table and use the PK for that value, or add
it to the db-table and find the PK for your new value.

cheers,
fober

===== EXAMPLE =====

<div style="width:200px; padding-right: 20px; border: 1px solid red">
<select id="text_select" size="5"

onchange="document.getElementById('text_edit').val ue=this[this.selectedIndex].
text; this.style.display= 'none'"
style="display:none; z-index:99; position:absolute; width:100%"
>

<option>Apple</option>
<option>Orange</option>
<option>Banana</option>
</select>
<input name="xyz" id="text_edit" type="Text" style="width:100%">
<input type="Button" value="\/"
onclick="document.getElementById('text_select').st yle.display= 'inline'"
style="position:absolute; float:right;"
>

</div>



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:31 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.