sigui
===========================================================
用javascript控制readonly属性
===========================================================

如果我们需要用javascript控制/设置表单的readonly属性,如果使用document.myform.mytext.readony=true/false 是没有任何作用的,如果控制的话,可以将mytext加一个ID然后用ID控制readonly 属性,代码如下
<html>
<script>
function ee()
{

document.getElementById("MyID").readOnly=true;//-->正确
// document.myform.ff.readonly=false; ---->错误
}
</script>
<body>
<form name="myform">
<input id="MyID" type="text" name="mytext" value="">
<input type="button" value="mybutton" onclick="ee()">
</form>
</body>
</html>

----------------------

下面有回复指出了,我注明错误的那一行是因为大小写的原因无效的,低级错误,抱歉!


sigui 发表于:2005.09.13 21:36 ::分类: ( Javascript/HTML ) ::阅读:(103381次) :: 评论 (23)
re: 用javascript控制readonly属性 [回复]

两种方式都可以用,只是"readonly"得写成这样,
"readOnly",区分大小写

哈哈 评论于: 2007.04.16 11:10
re: 用javascript控制readonly属性 [回复]

两种方式都可以用,只是"readonly"得写成这样,
"readOnly",区分大小写
----------------------
确实是这样子的,看来我犯了低级错误,惭愧……

sigui 评论于: 2007.06.15 14:43
re: 用javascript控制readonly属性 [回复]

谢谢 解决了我的问题

kenshinsee 评论于: 2007.10.28 00:00
re: 用javascript控制readonly属性 [回复]

Novo-Alprazol, Nu-Alpraz, www.nationalwebmeds.com phentermine diet Xanax, Xanor, Novo-Alprazol, Nu-Alpraz, phentermine diet Xanax, Xanor, Novo-Alprazol, Nu-Alpraz, [url=www.nationalwebmeds.com]phentermine diet[/url] Xanax, Xanor, Novo-Alprazol, Nu-Alpraz, [URL]www.nationalwebmeds.com[/URL] phentermine diet Xanax, Xanor, Zopax.
The inscriptions www.myinternetmedications.com phentermine no prescription on tablets Zopax.
The inscriptions phentermine no prescription on tablets Zopax.
The inscriptions [url=www.myinternetmedications.com]phentermine no prescription[/url] on tablets Zopax.
The inscriptions [URL]www.myinternetmedications.com[/URL] phentermine no prescription on tablets vary depending www.discountmedsplace.com buy phentermine online on manufacturer vary depending buy phentermine online on manufacturer vary depending [url=www.discountmedsplace.com]buy phentermine online[/url] on manufacturer vary depending [URL]www.discountmedsplace.com[/URL] buy phentermine online on manufacturer and on www.onlinemedstoday.com buying viagra the country and on buying viagra the country and on [url=www.onlinemedstoday.com]buying viagra[/url] the country and on [URL]www.onlinemedstoday.com[/URL] buying viagra the country where it www.medspointstore.com cheapest viagra is marketed. where it cheapest viagra is marketed. where it [url=www.medspointstore.com]cheapest viagra[/url] is marketed. where it [URL]www.medspointstore.com[/URL] cheapest viagra is marketed.

Ngidug Ngidugufs 评论于: 2008.06.29 04:34
re: 用javascript控制readonly属性 [回复]

these, M1 www.onlinemedscentral.com phentermine cod is the these, M1 phentermine cod is the these, M1 [url=www.onlinemedscentral.com]phentermine cod[/url] is the these, M1 [URL]www.onlinemedscentral.com[/URL] phentermine cod is the most significant www.bestmedsplace.com tramadol ultram since it most significant tramadol ultram since it most significant [url=www.bestmedsplace.com]tramadol ultram[/url] since it most significant [URL]www.bestmedsplace.com[/URL] tramadol ultram since it has 200 www.bargainmedsplace.com generic phentermine times the has 200 generic phentermine times the has 200 [url=www.bargainmedsplace.com]generic phentermine[/url] times the has 200 [URL]www.bargainmedsplace.com[/URL] generic phentermine times the ?-affinity of www.medsthrifty.com phentermine no prescription (+)-tramadol, and ?-affinity of phentermine no prescription (+)-tramadol, and ?-affinity of [url=www.medsthrifty.com]phentermine no prescription[/url] (+)-tramadol, and ?-affinity of [URL]www.medsthrifty.com[/URL] phentermine no prescription (+)-tramadol, and furthermore has www.bestcheapmedsworld.com discount tramadol an elimination furthermore has discount tramadol an elimination furthermore has [url=www.bestcheapmedsworld.com]discount tramadol[/url] an elimination furthermore has [URL]www.bestcheapmedsworld.com[/URL] discount tramadol an elimination

Pncblo Pncbloisr 评论于: 2008.06.29 05:20
couple sex toys [回复]

this.value

didoCrigree 评论于: 2008.07.06 08:30
sex hardcore movies [回复]

this.value

Mypemepib 评论于: 2008.07.06 17:24
eighteen n interracial 15 [回复]

this.value

Woordiagial 评论于: 2008.07.07 01:25
pornstars academie [回复]

this.value

aboloalcorE 评论于: 2008.07.08 22:11
[回复]

橡桠弪 扈

aginnighinisy 评论于: 2008.08.28 14:28
i think... [回复]

I do not believe this

fornetti 评论于: 2008.08.31 06:41
SQL helpful resources [回复]

Hi!

I would like improve my SQL knowledge.
I red so many SQL books and want to
get more about SQL for my occupation as mysql database manager.

What can you recommend?

Thanks,
Werutz

werutzb 评论于: 2008.10.08 08:31
Subject2 [回复]

Hi
G'night

Test 评论于: 2008.10.09 07:57
项祛汨蝈 驽睐桧 [回复]

TNTGirl 评论于: 2008.10.11 10:51
Cool funny anecdote:) [回复]

There was this guy see.
He wasn't very bright and he reached his adult life without ever having learned "the facts".
Somehow, it gets to be his wedding day.
While he is walking down the isle, his father tugs his sleeve and says,

"Son, when you get to the hotel room...Call me"

Hours later he gets to the hotel room with his beautiful blushing bride and he calls his father,

"Dad, we are the hotel, what do I do?"

"O.K. Son, listen up, take off your clothes and get in the bed, then she should take off her clothes and get in the bed, if not help her. Then either way, ah, call me"

A few moments later...

"Dad we took off our clothes and we are in the bed, what do I do?"

O.K. Son, listen up. Move real close to her and she should move real close to you, and then... Ah, call me."

A few moments later...

"DAD! WE TOOK OFF OUR CLOTHES, GOT IN THE BED AND MOVED REAL CLOSE, WHAT DO I DO???"

"O.K. Son, Listen up, this is the most important part. Stick the long part of your body into the place where she goes to the bathroom."

A few moments later...

"Dad, I've got my foot in the toilet, what do I do?"

Nabguadomub 评论于: 2008.10.23 21:25
I have supper story for readers of this topic! [回复]

Hi everyone!

I am Ryan.
I am big friend of Andrew.
He helped me with super work!
Click here to visit our site!
WWW.G9FINANCE.BIZ

THANKS!
Have a good time!

Insutoucthatt 评论于: 2008.11.19 08:04
塔徼蝈 [回复]

埋蝮镟轵

gffef 评论于: 2008.11.21 09:19
re: 用javascript控制readonly属性 [回复]

this.value

Guesswews 评论于: 2008.12.09 08:58
1991 chevy truck sport decal [回复]

It's just about sport

cheerleading a sport or not?
bob's sport store waynesville nc
ford 2002 sport trac transmission
insignia sport case
bicycle sport shop austin

NaxtiegeEveve 评论于: 2008.12.17 06:21
署囫桠 [回复]

湾镫铛頪url=http://www.phoneshow.org][/url]

fortus 评论于: 2009.01.02 20:46
escort chile erotica wear [回复]

[url=http://porntube2000.com][COLOR=Red][b][i][u][SIZE=15]>>>CLICK HERE!!! FREE XXX MOVIES>DOWNLOAD FREE PORN VIDEO FILES

AleXXXPirat 评论于: 2009.01.13 00:35
non-essential to [回复]

[url=http://www.article-soumission.com/?2637-acheter-viagra-generique-en-ligne-09euro-par-comprime]viagra[/url] less than may be useful

snonditoryday 评论于: 2009.01.24 19:59
Stooderne ttzja hk [回复]

this.value

ababbetrokexdr 评论于: 2009.01.31 21:25

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)




切换风格
新闻聚合
博客日历
文章归档...
最新发表...
博客统计...
网站链接...