表单元素名称会产生问题 [英] form element name creates problem

查看:68
本文介绍了表单元素名称会产生问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果元素名称中包含冒号,我该如何引用?


创建错误的示例:

======= ====================

objForm._ctl1:password.required = 1;

how can I reference an element name if it has a colon in it ?

example that creates error :
===========================
objForm._ctl1:password.required = 1;

推荐答案

On Sun,2004年9月19日11:04:05 -0700,TJS< no **** @ here.com>写道:
On Sun, 19 Sep 2004 11:04:05 -0700, TJS <no****@here.com> wrote:
如果元素名称中包含冒号,我如何引用元素名称?
how can I reference an element name if it has a colon in it ?




请阅读常见问题解答。


< URL:http://jibbering.com/faq/>


祝你好运,

Mike


-

Michael Winter

替换.invalid与.uk通过电子邮件回复。



Please read the FAQ.

<URL:http://jibbering.com/faq/>

Good luck,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


谢谢你的工作...


你能帮我看一下eval的报价吗?是吗?


代码

===========

eval(&'''objForm。元素。[\''''+ FullElemName +''\''] .requires = 1''");


错误:丢失;在声明之前

==============================

行: 40,专栏:22

源代码:


''objForm.elements。[''''+ FullElemName +''''] .required = 1''


" Michael Winter" < M ****** @ blueyonder.co.invalid>。在消息中写道

news:opsek56ndrx13kvk @ atlantis ...
thanks that works ...

can you help me with the quotes in the eval too?

code
===========
eval(" ''objForm.elements.[\'''' + FullElemName + ''\''].required = 1'' ");

Error: missing ; before statement
==============================
Line: 40, Column: 22
Source Code:

''objForm.elements.['' '' + FullElemName + ''''].required = 1''


"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:opsek56ndrx13kvk@atlantis...
On Sun,2004年9月19日11:04:05 -0700,TJS< no **** @ here.com>写道:
On Sun, 19 Sep 2004 11:04:05 -0700, TJS <no****@here.com> wrote:
如果元素名称中包含冒号,我该如何引用元素名称?
how can I reference an element name if it has a colon in it ?



请阅读常见问题解答。

< URL:http://jibbering.com/faq/>

祝你好运,
迈克

-
Michael Winter
替换.invalid与.uk通过电子邮件回复。



Please read the FAQ.

<URL:http://jibbering.com/faq/>

Good luck,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.



On Sun,2004年9月19日11:37:25 -0700,TJS< no **** @ here .COM>写道:
On Sun, 19 Sep 2004 11:37:25 -0700, TJS <no****@here.com> wrote:
你能帮助我在eval中引用它吗?


什么评价?常见问题建议的代码并不需要。我建议你阅读

4.40和4.39。

eval(&'''objForm.elements。[\''''+ FullElemName +''\ ''] .required = 1''");
can you help me with the quotes in the eval too?
What eval? The code the FAQ suggests doesn''t need one. I suggest you read
4.40 and 4.39, too.
eval(" ''objForm.elements.[\'''' + FullElemName + ''\''].required = 1'' ");




使用原始示例:


objForm.elements [ ''_ctll:password'']。required = 1;


注意句点的位置。


如果需要是布尔值,使用布尔值:


objForm.elements [''_ ctll:password''] .require = true;


希望有所帮助,

迈克


-

Michael Winter

替换.invalid与.uk通过电子邮件回复。



Using your original example:

objForm.elements[''_ctll:password''].required = 1;

Note the position of the periods.

If required is a boolean, use boolean values:

objForm.elements[''_ctll:password''].required = true;

Hope that helps,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


这篇关于表单元素名称会产生问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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