Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Problem With The ReadOnly Property
TavoxPeru
post Aug 30 2006, 10:10 AM
Post #1


Super Member
Group Icon

Group: [HOSTED]
Posts: 740
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



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:
CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script LANGUAGE="JavaScript">
<!-- Begin
function 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,
Go to the top of the page
 
+Quote Post
seec77
post Aug 30 2006, 11:12 AM
Post #2


Advanced Member
Group Icon

Group: Members
Posts: 157
Joined: 16-May 06
Member No.: 13,476



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! biggrin.gif
Go to the top of the page
 
+Quote Post
TavoxPeru
post Aug 30 2006, 10:51 PM
Post #3


Super Member
Group Icon

Group: [HOSTED]
Posts: 740
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



QUOTE(seec77 @ Aug 30 2006, 06:12 AM) *

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! biggrin.gif

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

best regards,
Go to the top of the page
 
+Quote Post
iGuest
post Jun 4 2008, 10:06 AM
Post #4


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Problem With Drag And Drop (or So It Seems).(11)
  2. Photoshop Cropping Problem(6)
  3. Administrator Account Problem In Microsoft Xp [solved](20)
  4. Error 406 - Problem In My Phpbb Forum(8)
  5. A Gaiaonline Problem(8)
  6. Trojan / Virus Problem ,please Help(17)
  7. Need To Hack An Admin Account On Xp... No Problem!(61)
  8. Fedora Core 6 Install Problem(6)
  9. Internet Explorer 7 Problem(8)
  10. Problem: I Need Urgent Help. Can't Boot.(9)
  11. Frustrating Problem With XP On Laptop(19)
  12. Spam Problem On My Forums(25)
  13. Problem With Move_uploaded_file()(5)
  14. XP Problem: Clicking On Folder Opens Search(4)
  15. Einstein Quiz(29)
  1. Blue Screen - irql_not_less_or_equal(29)
  2. Mozilla Firefox And Runescape(10)
  3. Problem With Acdsee(4)
  4. Laptop Overheating(15)
  5. Problem Deleting Empty Folder In Win XP(13)
  6. Problem With Purchase Credits Page(7)
  7. Mp3 Player Problem: Sound In One Ear Only(8)
  8. Permission Problem With Mysql Database Creation(8)
  9. Mysql Problem(1)
  10. Live Messenger Display Pic Problem(5)
  11. I Can't Turn Off My Computer(9)
  12. Problem: Network Connection Fails Every 2 Mins(12)
  13. DVD-RW Problem: Unformatted Disk(6)
  14. Whats Wrong In Altec Lansing Sound System ?(5)
  15. The Problem With #(1)


 



- Lo-Fi Version Time is now: 21st August 2008 - 11:08 PM