SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Oct 2004
    Location
    NYC
    Posts
    306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    textbox greys out when the pages is reloaded...HELLP

    Helllo,

    I have two fields on my form:

    1. CHECKBOX
    2. TEXTBOX

    By default TEXTBOX remains disabled unless CHECKBOX is checked by user which works wondefully. The issue is that the TEXTBOX value greys out if form is returned or reloaded. I am trying to keep the the TEXTBOX value active even if the form is reloaded.

    Here is the little function which enables the TEXTBOX via CHECKBOX


    <script type="text/javascript">
    function webBanner(el3,el4){
    document.getElementById(el3).onclick=function(){
    if(this.checked){
    document.getElementById(el4).removeAttribute('disabled')
    }
    else {
    document.getElementById(el4).setAttribute('disabled','true')
    document.getElementById(el4).value= "";

    }
    }
    }
    </script>

  2. #2
    SitePoint Addict Mirek Komárek's Avatar
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you can set onload
    Code:
    document.getElementById(el3).checked='';
    document.getElementById(el4).setAttribute('disabled','true');
    document.getElementById(el4).value='';


Bookmarks

Posting Permissions

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