使用coldfusion自动填充表单字段 [英] Auto fill form fields using coldfusion

查看:85
本文介绍了使用coldfusion自动填充表单字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿所有人,


我不知道我的问题应该是javascript / ajax还是coldfusion,我认为这更像是一个冷血问题。但是,如果这是错误的部分让我知道一个很高兴删除我的问题,把它放在正确的部分。


我想要做的是非常简单。我有一个输入字段,有人开始输入客户编号。当他们输入客户编号时,将填充下拉框。然后他们点击下拉框,填写表格的其余部分(它从数据库中获取所有信息)。


我在网上发现了一个几乎完全符合我的脚本想做,除了它是在PHP。我已经在除了coldfusion之外的所有语言中找到了这个例子,我必须承认我不擅长将代码从一种语言转换为另一种语言。


但无论如何我想知道是否有人能够为我提供一个关于如何在coldfusion而不是php中执行此操作的示例?或者如果你知道我可以看一下教程,论坛或在线示例?


这是示例页面
http://www.dhtmlgoodies.com/scripts/...nt-lookup。 HTML


这里是代码
http://www.dhtmlgoodies.com/index.ht..._client_lookup


i已经创建了下拉框部分这个(因为它在上面的例子中缺少了
),但就像我说的那样我只是无法弄清楚如何使用我的coldfusion数据库来填充它。以下是我在下拉框中获得的内容


这里是coldfusion / html

Hey Everyone,

Well i don''t know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all gladly delete my question an put it in the correct section.

Well what i am trying to do is pretty simple. I have a input field and someone starts typing in a customer number. As they type in the customer number the drop down box is populated. They then click on the drop down box an the rest of the form is populated (it gets all the information from a database).

I found a script online that does almost exactly what i want to do except it is in php. I have found an example of this in every language except coldfusion and well i must admit i am not good at converting code from one language to another.

But anyway i was wondering if anyone could provide me with an example on how i would do this in coldfusion instead of php? or if you know of a tutorial,forum, or example online i could look at?

Here is the example page
http://www.dhtmlgoodies.com/scripts/...nt-lookup.html

an here is the code
http://www.dhtmlgoodies.com/index.ht..._client_lookup

i already created the drop down box part of this (since it is missing in the
the example above), but like i said i just can''t figure out how i would populate it using my coldfusion database. Here is what i got for the drop down box

here is coldfusion/html

展开 | 选择 | 换行 | 行号

推荐答案

为了填充下拉框和文本框,您将需要JavaScript。如果您遇到该部分的问题,请在JavaScript论坛中启动一个新线程。


为了从数据库中获取值,您显然需要Coldfusion。如果你想将那个PHP文件转换为Coldfusion,那并不是那么困难,尽管我不喜欢它是如何完成的。如果你感兴趣,还有更好的方法。
For the populating of the dropdown box and the text boxes, you will need JavaScript. If you''re having problems with that part, start a new thread in the JavaScript forum.

For getting the values from the database, you will obviously need Coldfusion. If you want to convert that PHP file to Coldfusion, it''s not that difficult, though I don''t like how it''s done. There''s a better way if you''re interested.


Hey Acoder,


如果你有更好的方法,肯定会感兴趣从数据库中获取值。我想我可以找出javascript部分,只是在coldfusion部分丢失了。


提前致谢,

Rach
Hey Acoder,

definately interested if you have a better way to go about getting the values from the database. I think i can figure out the javascript part, just very lost on the coldfusion part.

Thanks in advance,
Rach

更好的方法是不输出要在链接的示例中进行评估的JavaScript。您可以输出要直接插入的HTML,或者要解析的XML或JSON。


根据您的描述,您似乎要提出两个请求。一个用于填充下拉列表,另一个用于填充字段。数据库中的选项也是吗?
The better way would involve not outputting JavaScript to be eval-ed as in the example you linked to. You can output HTML to be inserted directly, or XML or JSON to be parsed.

From what you''ve described, it seems you''re going to make two requests. One to populate the drop down and the second one to populate the fields. Are the options from a database too?


这篇关于使用coldfusion自动填充表单字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆