GroupBrowser  




Go Back   GroupBrowser > Macromedia Newsgroups > Coldfusion > Coldfusion General Discussion
User Name
Password
 
 
Thread Tools Search this Thread Display Modes

cfselect
Old 08-28-2008, 03:53 AM #1
ysurati01
Guest
 
Status:
Posts: n/a
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

Re: cfselect
Old 08-28-2008, 03:07 PM #2
CF_output
Guest
 
Status:
Posts: n/a
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

Re: cfselect
Old 08-28-2008, 06:27 PM #3
fober1
Guest
 
Status:
Posts: n/a
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').value=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').style.displ ay= 'inline'"
style="position:absolute; float:right;"
>

</div>



  Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes





Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump




Adobe Newsgroups | Software Newsgroups


Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2003-2004 All Rights Reserved GroupBrowser LLC.