重复选择控件 [英] duplicate select controls

查看:48
本文介绍了重复选择控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个表单控件供用户输入货币符号。

选择控件似乎适合这个目的;

但问题是控件必须多次出现在页面上

所以页面大小的公式从下面按控制数乘以货币数量限制。

这意味着

1)页面必须动态生成才能保持一致,

2)要传输的数据可能会过度增长,因为页面将包含大量冗余信息

3)它会在浏览器上产生不必要的压力以维护所有这些选择元素。

考虑到这一点后,我我决定继续使用文本控件进行验证。

这些注意事项是否正确?我觉得HTML在这里缺少一些重要的抽象。

克里斯

I need a form control for the user to enter currency symbol.
A select control seems to be fit for that purpose;
but the problem is that the control must appear on the page several times
so the formula for page size gets bounded from below by number of controls times number of currencies.
Which means that
1) the page must be produced on the fly in order to be consistent,
2) the data to be transmitted can grow excessively because the page will contain much redundant information
3) it creates unnecessary strain upon the browser to maintain all these select elements.
Upon taking this into account, I decided I would stay with a text control to be validated afterwards.
Are those considerations correct? I feel that HTML lacks some important abstraction here.
Chris

推荐答案

凝视我的水晶球我观察到K?i1tof ?elechovski

< gi ****** @ stegny.2a.plwriting in

新闻:呃*********** @ news2 .ipartners.pl:
Gazing into my crystal ball I observed K?i1tof ?elechovski
<gi******@stegny.2a.plwriting in
news:er***********@news2.ipartners.pl:

我需要一个表格控件供用户输入货币符号。

选择控件似乎适合那个目的;

但问题是控件必须在页面上显示几个

次,所以页面大小的公式从下面按数字限制

控制次数乘以货币数量。这意味着

1)页面必须动态生成才能保持一致,

2)要传输的数据可能会因页面而过度增长/>
将包含许多冗余信息3)它在浏览器上创建了不必要的

应变以维护所有这些选择元素。在考虑到这一点后,我决定使用文本控件

进行验证。这些考虑是否正确?我觉得

HTML在这里缺少一些重要的抽象。 Chris
I need a form control for the user to enter currency symbol.
A select control seems to be fit for that purpose;
but the problem is that the control must appear on the page several
times so the formula for page size gets bounded from below by number
of controls times number of currencies. Which means that
1) the page must be produced on the fly in order to be consistent,
2) the data to be transmitted can grow excessively because the page
will contain much redundant information 3) it creates unnecessary
strain upon the browser to maintain all these select elements. Upon
taking this into account, I decided I would stay with a text control
to be validated afterwards. Are those considerations correct? I feel
that HTML lacks some important abstraction here. Chris



页面顶部的内容如下:

< label for =" currency">您的货币? < / label>

< select name =" currency" id =" currency">

< option value =" 1"> Dollars< / option>

< option value =" 2"> ; Euros< / option>

< option value =" 3"> Yen< / option>

< option value =" 4"> Darsek< ; / option>

< / select>

....表单的其余部分


-

Adrienne Boswell在家

Arbpen网站设计服务
http://www.cavalcade-of-coding.info

请回复群组,以便其他人分享

How about at the top of the page something like:
<label for="currency">Your currency? </label>
<select name="currency" id="currency">
<option value="1">Dollars</option>
<option value="2">Euros</option>
<option value="3">Yen</option>
<option value="4">Darsek</option>
</select>
....the rest of the form

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share




U?ytkownik" Adrienne Boswell" < ar **** @ yahoo.comnapisa3 w wiadomo?ci news:Xn **************************** @ 69.28.186.121 。 ..

U?ytkownik "Adrienne Boswell" <ar****@yahoo.comnapisa3 w wiadomo?ci news:Xn****************************@69.28.186.121. ..

凝视着我的水晶球我观察到K?i1tof?elechovski

< gi ****** @ stegny。 2a.pl写在

新闻:呃*********** @ news2.ipartners.pl:
Gazing into my crystal ball I observed K?i1tof ?elechovski
<gi******@stegny.2a.plwriting in
news:er***********@news2.ipartners.pl:

> ;我需要一个表单控件供用户输入货币符号。
一个选择控件似乎适合那个目的;
但问题是控件必须在页面上出现几次
次,所以页面大小的公式从下面按数字限制<控制次数乘以货币数量。这意味着
1)页面必须在运行中生成以保持一致,2)要传输的数据可能会过度增长,因为页面将包含很多冗余信息3 )它在浏览器上产生了不必要的压力,以维护所有这些选择元素。在考虑到这一点后,我决定继续使用文本控件
进行验证。这些考虑是否正确?我觉得HTML缺少一些重要的抽象。 Chris
>I need a form control for the user to enter currency symbol.
A select control seems to be fit for that purpose;
but the problem is that the control must appear on the page several
times so the formula for page size gets bounded from below by number
of controls times number of currencies. Which means that
1) the page must be produced on the fly in order to be consistent,
2) the data to be transmitted can grow excessively because the page
will contain much redundant information 3) it creates unnecessary
strain upon the browser to maintain all these select elements. Upon
taking this into account, I decided I would stay with a text control
to be validated afterwards. Are those considerations correct? I feel
that HTML lacks some important abstraction here. Chris



页面顶部的内容如下:

< label for =" currency">您的货币? < / label>

< select name =" currency" id =" currency">

< option value =" 1"> Dollars< / option>

< option value =" 2"> ; Euros< / option>

< option value =" 3"> Yen< / option>

< option value =" 4"> Darsek< ; / option>

< / select>

...表格的其余部分

How about at the top of the page something like:
<label for="currency">Your currency? </label>
<select name="currency" id="currency">
<option value="1">Dollars</option>
<option value="2">Euros</option>
<option value="3">Yen</option>
<option value="4">Darsek</option>
</select>
...the rest of the form



问题是每次在页面上显示货币控制时必须重复相同的代码,

并且可以多次显示。

这会导致轻微的维护问题(每次出现的选项必须相同)

和一个主要的性能问题(如果允许多种货币,客户端的潜在代码膨胀) )。


Chris

The problem is the same code must be repeated each time a currency control is presented on the page,
and it can be presented several times.
This causes a minor maintenance problem (the options must be the same for each occurrence)
and a major performance problem (potential code bloat on client side if many currencies are allowed).

Chris


Scripsit K?i1tof?elechovski:
Scripsit K?i1tof ?elechovski:

我需要一个表单控件供用户输入货币符号。
I need a form control for the user to enter currency symbol.



是什么让你如此想的?在大多数情况下,这听起来像是没有意义的东西

,除非表格的目的与货币有关

符号(不是货币或货币或交易,而是货币符号)作为符号)。

What makes you think so? It sounds like something that does not make sense
in most contexts, except when the purpose of the form relates to currency
symbols (not currencies or money or trade but currency symbols as symbols).


选择控件似乎适合于此目的;
A select control seems to be fit for that purpose;



然后您实际需要的是用于指定货币的表单控件。

休息取决于可以使用的货币数量。例如,如果

允许任何货币,那么显然最好有一个

三字母输入字段和一个国际货币表的链接

代码。如果只接受两种或三种货币,请使用收音机

按钮。具有合适尺寸=......的选择元素。属性也可以使用

,但使用起来有点笨拙。

Then what you actually need is a form control for specifying currency. The
rest depends on the amount of currencies that can be used. For example, if
any currency is to be allowed, then it is clearly best to have a
three-letter input field and a link to a table of international currency
codes. If there are just two or three currencies accepted, use radio
buttons. A select element with a suitable size="..." attribute could be used
too, but it''s somewhat clumsier to use.


但问题是控件必须出现在页面几个


but the problem is that the control must appear on the page several
times



为什么?如果有充分的理由(我怀疑),那么选择元素

size =" 1" (默认值)可能是可以防御的。

Why? If there is a good reason (which I doubt), then a select element with
size="1" (the default) might be defendable.


所以页面大小的公式从下面被数量限制

控制时间货币数量。
so the formula for page size gets bounded from below by number of
controls times number of currencies.



这与所有实际目的无关。是什么让你认为这将是一个重大问题。

That''s irrelevant for all practical purposes. What makes you think it would
be a significant problem.


这意味着

1)页面必须在飞行中生成才能保持一致,
Which means that
1) the page must be produced on the fly in order to be consistent,



什么?为什么?

What? Why?


2)要传输的数据可能会过度增长,因为页面

将包含大量冗余信息
2) the data to be transmitted can grow excessively because the page
will contain much redundant information



如果这是一个问题,那么表单本身就会过度生长,这对用户来说是个噩梦。

If that''s a problem, then the form itself is overgrown and a nightmare to
the user.


3)它会在浏览器上造成不必要的压力,以维持这些选择元素的所有元素。
3) it creates unnecessary strain upon the browser to maintain all
these select elements.



可能有一些道理。浏览器可能有页面问题

包含大量的表单控件;至少有一些旧的浏览器。但是

然后解决方案是将表单拆分成更小的部分并动态地链接它们或者只是简化表单。

There might be some truth in that. Browsers may have problems with pages
contain a huge number of form controls; at least some old browsers did. But
then the solution would be to split the form into smaller parts and chain
them dynamically - or maybe just simplify the form.


考虑到这一点后,我决定继续使用文本

控件进行验证。
Upon taking this into account, I decided I would stay with a text
control to be validated afterwards.



我希望你没有考虑使用选择元素_without_服务器端

检查。永远不要相信微笑的猫或网页上的表格;期待获得
垃圾,处理它,将实际提交的内容与垃圾邮件分开以及其他

攻击。

I hope you didn''t think about using a select element _without_ server-side
checking. Never trust a smiling cat, or a form on a web page; expect to get
junk, deal with it, separating real submissions from spamming and other
attacks.


我觉得HTML在这里缺少一些重要的抽象。
I feel that HTML lacks some
important abstraction here.



HTML表单模型是一个简单的想法,以一种令人困惑的方式制定和实现。使用HTML表单的唯一原因是它们只是网上大多数交互的唯一可靠用户界面。


-

Jukka K. Korpela(Yucca)
http ://www.cs.tut.fi/~jkorpela/

The HTML form model is a simplistic idea formulated and implemented in a
confusing way. The only reason for using HTML forms is that they are the
only reliable user interface for most interactions on the web.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


这篇关于重复选择控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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