Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    make certain fields readonly and unselectable on event

    Hi,

    Still working on http://www.aendekerk.be/beta/airco/bereken.html
    Is it possible to make certain fields readonly and unselectable when another field has a certain value?

    This is what i want:
    * When b1x1_tot_view or b1x2_tot_view does NOT contain an X, make b3x1_x3, b3x2_x3, b3x3_x3 and b3x4_x3 readonly, unselectable, reset to zero and the background of this field should be gray.

    * When b1x3_tot_view does NOT contain an X, make b3x1_x1, b3x2_x1, b3x3_x1, b3x4_x1, b3x1_x2, b3x2_x2, b3x3_x2 and b3x4_x2 readonly, unselectable, reset to zero and the background of this field should be gray.

    * When b1x4_tot_view does NOT contain an X, make b3x1_x2, b3x2_x2, b3x3_x2, b3x4_x2, b3x1_x3, b3x2_x3, b3x3_x3 and b3x4_x3 readonly, unselectable, reset to zero and the background of this field should be gray.

    With readonly and unselectable, i mean something like:
    Code:
    <input type="text" name="b3x1_x2" size="1" readonly unselectable>

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It would be much more appropriate if you kept these continual changes to one thread. As it is now. This script is scattered amongst 3-5 threads and it would be easier for someone to modify the script that validated the has X's which was provided for you than to visit your page and start anew by accessing your external javascript(s) files.

    No offense. But I was wishing to help but do not want to start searching for the other threads or the external file. I would suggest that you aide us helping you by providing links to the other threads.

    .....Willy

  • #3
    New Coder
    Join Date
    Feb 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #4
    New Coder
    Join Date
    Feb 2004
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    I've found something on the internet about it:
    Code:
    document.getElementById('some_field').readOnly=true;">
    But how do i also make it unselectable, reset to zero and with gray background at the same time?

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    document.getElementById('some_field').disabled=true;"
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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