Results 1 to 2 of 2

Thread: Text field and readonly with JS

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Text field and readonly with JS

    Is it possible to make a function with JS that make a text field readonly? I have tried to use disabled, but if I use this I can read the input with a request.

    Code:
    if (kom==10 || kom==11 || kom==12 || kom==13 || kom==14) {
    			document.forside.elements('l1'+j).disabled=false;
    			document.forside.elements('l2'+j).disabled=false;
    		}

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    You can alter the HTML attribute 'readOnly' using client-side scripting.

    E.g.

    Code:
    document.forms('formname').object.readOnly=true;
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

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



Click Here to Expand Forum to Full Width