动态填充表单字段取决于下拉框 [英] Dynamic fill form fields depending on dropdown box

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

问题描述

你好清单


这个问题可能已经被问到了,但让我再问一遍


我有一个mysql数据库连接我的PHP脚本。

数据库包含文章。姓名,单位_工资和参考


现在我的客户需要订购5个项目,点击一个按钮和一个包含5行/ b $ b行的表格,并显示3列(到现在为止)简单)


在第一列是一个带有< select>的下拉框和<选项>在

,我存储了所有可能的名字。


我想比客户更换其中一个盒子时(在我的
$ b $中) b情况有5)他刚刚选择的

行中的Unite_Price列和Reference列自动更新

我在网上搜索但我找不到它。


感谢您的帮助


Alex

解决方案

Alex写道:

你好清单

这个问题可能已经被问到了,但让我再问一次

我有一个我用php脚本连接的mysql数据库。
数据库包含文章。姓名,单位_工资和参考

现在我的客户需要订购5个项目,点击一个按钮,一个有5行/ 3行的表格出现(现在很容易)

在第一列是一个下拉框,其中包含< select>和<选项>在
中我存储了所有可能的名称。

我希望客户端更改其中一个框(在我的
情况下有5个)Unite_Price列和Reference列在
行中他只是选择自动更新


你在这里谈论Javascript吗?

你想要用户做一个选择吗?您的页面和页面将填写

相应的字段?然后去Javascript。


或者如果有人接触选择框你想回到服务器吗?

然后是PHP。

我认为你最好用Javascript做这件事。

尝试comp.lang.javascript。


如果你想用PHP做,那么。 ..从哪里开始?

你知道如何用PHP接收表格吗? (


_POST []等)

你知道如何用PHP将动态数据放入你的html页面吗?

如果您想在PHP中执行此操作,请更具体并提出问题

这是一个问题,而不是问题的完整解决方案

除了你,这里知道。 :-)


我在网上搜索但我找不到它。


真的吗?

这是非常基本的东西(无论是Javascript还是PHP)所以我想知道你为什么这么做?
didn''找到任何做类似事情的代码。

(不打算打)


祝你好运。


问候,

Erwin Moller

感谢您的帮助

Alex



< >

Erwin Moller写道:

Alex写道:

你好清单

这个问题可能已经被问到了,但让我再问一下

我有一个mysql数据库,我用我的PHP脚本连接。
数据库包含文章。姓名,单位_工资和参考

现在我的客户需要订购5个项目,点击一个按钮,一个有5行/ 3行的表格出现(现在很容易)

在第一列是一个下拉框,其中包含< select>和<选项>在
中我存储了所有可能的名称。

我希望客户端更改其中一个框(在我的
情况下有5个)Unite_Price列和Reference列在
行中他只选择自动更新



你在这里谈论Javascript吗?
你想让用户在你的页面上做一个选择吗?页面将填写相应的字段?然后去Javascript。

或者如果有人接触选择框你想回到服务器吗?
然后它是PHP。

我认为你最好做这个用Javascript。
试试comp.lang.javascript。

如果你想用PHP做,那么......从哪里开始?
你知道怎么收吗? PHP中的表单? (


Hello list

This question has probably already been asked, but let me ask again

I have a mysql database to which I connect with my php scripts. The
database contains articles. Name, Unit_Price and Reference

Now my client needs to order 5 items, click a button and a table with 5
lines and 3 columns appears (until now easy)

In the first column is a drop down box with a <select > and <options> in
which I store all possible names.

I would like than whenever the client changes one of the boxes (in my
case there are 5) the Unite_Price column and Reference column in the
line he just choose get automatically updated
I search all over the web but I could not find it.

Thank you for your help

Alex

解决方案

Alex wrote:

Hello list

This question has probably already been asked, but let me ask again

I have a mysql database to which I connect with my php scripts. The
database contains articles. Name, Unit_Price and Reference

Now my client needs to order 5 items, click a button and a table with 5
lines and 3 columns appears (until now easy)

In the first column is a drop down box with a <select > and <options> in
which I store all possible names.

I would like than whenever the client changes one of the boxes (in my
case there are 5) the Unite_Price column and Reference column in the
line he just choose get automatically updated

Are you talking about Javascript here?
Do you want the user to do a select on your page and the page will fill the
appropriate fields? Then go Javascript.

Or do you want to go back to the server if somebody touches the selectbox?
Then it is PHP.
I think you better do this with Javascript.
Try comp.lang.javascript.

If you want to do it in PHP, well... where to start?
Do you know how to receive a form in PHP? (


_POST[] and the like)
Do you know how to put dynamical data into your html-page with PHP?

If you want to do this in PHP, please be more specific and ask a question
that is answerable instead of the complete solution to a problem nobody in
here knows except you. :-)


I search all over the web but I could not find it.
Really?
This is quite basic stuff (both in Javascript and PHP) so I wonder why you
didn''t find any code that does similar things.
(No punch intended)

Good luck.

Regards,
Erwin Moller

Thank you for your help

Alex




Erwin Moller wrote:

Alex wrote:

Hello list

This question has probably already been asked, but let me ask again

I have a mysql database to which I connect with my php scripts. The
database contains articles. Name, Unit_Price and Reference

Now my client needs to order 5 items, click a button and a table with 5
lines and 3 columns appears (until now easy)

In the first column is a drop down box with a <select > and <options> in
which I store all possible names.

I would like than whenever the client changes one of the boxes (in my
case there are 5) the Unite_Price column and Reference column in the
line he just choose get automatically updated



Are you talking about Javascript here?
Do you want the user to do a select on your page and the page will fill the
appropriate fields? Then go Javascript.

Or do you want to go back to the server if somebody touches the selectbox?
Then it is PHP.
I think you better do this with Javascript.
Try comp.lang.javascript.

If you want to do it in PHP, well... where to start?
Do you know how to receive a form in PHP? (


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

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