开发者

CFInput autosuggest: where is the value?

I used a simple CFInput autosuggest code (copied from Ben Forta's blog). It works ok, but I need one additional feature:

After a user has used the autosuggest field to choose something, I would like to populate a second form field with th开发者_开发技巧e result ... but it doesn't work like in Javascript (using onChange and the value property of the field) - it seems that the "value" property contains the original user input, not what he chooses from the autosuggest list. For the life of it I can't find out how to copy the chosen autosuggest value to another field using Javascript. Anyone?


Can you post your code? My guess is you want the second cfinput to be similar to line with *'s:

<cfform>
Art:
<cfinput type="text"
        name="artname"
        autosuggest="cfc:art.lookupArt({cfautosuggestvalue})">
**<cfinput type="text" name="second" bind="{artname}"/>**
</cfform> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜