我可以为多个选项制作一个值吗? [英] can i make one value to many option ?

查看:80
本文介绍了我可以为多个选项制作一个值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。假设我在MySQL中的表有一个列调用NUMBER。在这一栏中,它的值为1,2,3。现在我想让1,2,3作为选项供用户选择。

代码应该是什么?


2.这是代码是对吗?

<选择NAME =" field2">

< Option VALUE =''NUMBER''> 1< / Option>

< Option VALUE =''NUMBER> 2< / Option>

< / Select>

解决方案

如果如果要从数据库中填充这些字段,则必须以不同方式执行此操作。但基本上,您提供的代码应为(3个数字)

(值=传递给您的表单,>和<之间的值显示给用户)。

[HTML]

< Select NAME =" field2">

< Option VALUE =''1''> Number 1< /选项>

<选项VALUE =''2''>数字2< /选项>

<选项VALUE =''3''>数字3< / Option>

< /选择> [/ HTML]


Ronald:很酷:


< blockquote class =post_quotes>
如果要从数据库中填充这些字段,则必须采用不同的方式。但基本上,您提供的代码应为(3个数字)

(值=传递给您的表单,>和<之间的值显示给用户)。

[HTML]

< Select NAME =" field2">

< Option VALUE =''1''> Number 1< /选项>

<选项VALUE =''2''>数字2< /选项>

<选项VALUE =''3''>数字3< / Option>

< /选择> [/ HTML]


罗纳德:很酷:



谢谢你的回复。现在我有另一个问题是,我上次从这个论坛获得的代码生成了超链接。



while(


< blockquote> result = mysql_fetch_array(


1. let say my table in MySQL have a column call NUMBER. In this column it would be value 1,2,3. Now i want to make the 1,2,3 as option to user to choose.
what the code should be?

2. is it this code is right?
<Select NAME="field2">
<Option VALUE=''NUMBER''>1</Option>
<Option VALUE=''NUMBER>2</Option>
</Select>

解决方案

If you want to populate these fields from the database, you have to do that differently. But basically, the code you presented should be (for 3 numbers)
(the value= is passed to your form, the value between > and < is displayed to the user).
[HTML]
<Select NAME="field2">
<Option VALUE=''1''>Number 1</Option>
<Option VALUE=''2''>Number 2</Option>
<Option VALUE=''3''>Number 3</Option>
</Select>[/HTML]

Ronald :cool:


If you want to populate these fields from the database, you have to do that differently. But basically, the code you presented should be (for 3 numbers)
(the value= is passed to your form, the value between > and < is displayed to the user).
[HTML]
<Select NAME="field2">
<Option VALUE=''1''>Number 1</Option>
<Option VALUE=''2''>Number 2</Option>
<Option VALUE=''3''>Number 3</Option>
</Select>[/HTML]

Ronald :cool:

thank you for your reply. now i have another question is that i had generate the hyperlink as the code last time i get from this forum.


while(


result = mysql_fetch_array(


这篇关于我可以为多个选项制作一个值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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