Jump to content
Xisto Corporation
TavoxPeru

Problem With The ReadOnly Property

Recommended Posts

I have a problem setting the readonly property of a textbox which depends on a yes and no radio buttons selection, I'm sure that my code is correct but i dont know why nothing happens.
This is code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE> New Document </TITLE><script LANGUAGE="JavaScript"><!-- Beginfunction changeRadio(sVal) {	if (sVal=='n')	{		a.textval.readonly=true;		a.texval.value="";	}	else {		a.textval.readonly=false;	}}//  End --></script></HEAD><BODY><form name="a" method="post"><table class="tabla" width="100%" border="0" cellpadding="2" cellspacing="10">   <tr>   <td width="32%">READONLY TEXTBOX</td>   <td>   <input type="radio" value="n" name="radiobtn" onclick="changeRadio('n')" CHECKED>No<BR /><input type="radio" value="s" name="radiobtn" onclick="changeRadio('s')">Yes</td>   </tr>   <tr>   <td class='textoedicion' width="32%">TEXTBOX</td>   <td><input type="text" name="textval" value='' size="21" maxlength="20"></TD>	</tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="100%" align="center" valign="middle"><input type="submit" name="submit" value="Save"> <input type="button" name="cancel" value="Cancel" onClick="window.close()"></td></tr></table></form><script language="JavaScript" type="text/javascript"><!--if (document.a.radiobtn[0].checked) {	document.a.textval.readonly=true;}else {	document.a.textval.readonly=false;}//--></script></BODY></HTML>
Best regards,

Share this post


Link to post
Share on other sites

Took me a couple of minutes and a little search over here to understand your problem. Javascript is a case conscious language, and so you have to write "readOnly" instead of "readonly". A very simple find and replace should solve your problem! :)

Share this post


Link to post
Share on other sites

Took me a couple of minutes and a little search over here to understand your problem. Javascript is a case conscious language, and so you have to write "readOnly" instead of "readonly". A very simple find and replace should solve your problem! :)

Thanks a lot, i just search and replace and run it, and everything works fine.

best regards,

Share this post


Link to post
Share on other sites

Why does the Alert dialog box state -4bf has no properties when starting FireFox 2

Problem With The ReadOnly Property

 

The last 2-3 days I have been unable to access my FireFox 2 program.

The first page of the Firefox 2 program appears and then a popup box appears stating:

 

Alert.

TypeError: -4bf has no properties

I have downloaded a fresh copy of Firefox 2, with the same result

Please, can you help me?

 

elwaltura

 

-question by Walter Earnshaw

Share this post


Link to post
Share on other sites
FireFox profile corruptProblem With The ReadOnly Property

Previous poster: Your Firefox profile is probably corrupt. Try starting FireFox from the command-line with the -ProfileManager option and create a new fresh profile.

-reply by Marlin

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.