disable property not working in netscape

Results 1 to 2 of 2

Thread: disable property not working in netscape

  1. #1
    Join Date
    Dec 1969

    Default disable property not working in netscape

    i am using the following javascript to disable some textboxes when you select a value in combo box.its working fine in internet explorer but not in netscape.can someone modify so that it works bothe IE and Netscape.thanks a lot<BR><BR>function disable_it(){ <BR>Store=FORM1.Report.value; <BR>if (Store == 9) { <BR><BR>FORM1.Days.disabled=false; <BR>FORM1.from.disabled=true; <BR>FORM1.to.disabled=true; <BR>} <BR>else if (Store == 0){ <BR>FORM1.from.disabled=false; <BR>FORM1.to.disabled=false; <BR>FORM1.Days.disabled=true; <BR>} <BR>else { <BR><BR>FORM1.Days.disabled=true; <BR>FORM1.from.disabled=true; <BR>FORM1.to.disabled=true; <BR>} <BR><BR>return; <BR>} <BR>i tried using FORM1.Days.readonly=true;<BR><BR>but even that is not working.please help me before the holidays start.thanks in advance

  2. #2
    Pedantic Bill Guest

    Default RE: disable *CORRECTLY* not working in NS

    &nbsp;<BR>The disable property is *only* supported by MSIE.<BR><BR>Netscape is not the only browser that chooses to ignore MSIE extensions.<BR><BR>The best you can do that is cross-browser compatible is something like this: <BR><BR>&#060;INPUT Type=Text Name="Days" <BR> onFocus="if (FORM1.report.value != 9) this.blur();"&#062;<BR><BR>That is, if you want to disable the field, just make it impossible for the user to put the cursor anywhere in the field.<BR><BR>(You&#039d probably want to make a function call instead of coding it inline as I did there for illustration purposes.)<BR><BR>Incidentally, this is clearly not an ASP-related question. For help on JavaScript issues, take a look at the JS FAQ at http://www.irt.org (more than likely something like my answer is sitting there waiting for you).<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts