SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member ruddhim's Avatar
    Join Date
    Mar 2005
    Location
    India
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Accessing and Changing Form Elements

    I have 4 checkboxes in my form and wanna change the number (to be displayed) according to the selection made on the ListBox \ Menu

    HTML PART of the code

    <select name= "rights" onChange="chk_Count(this);">
    <option value = 0 > Admin </option>
    <option value = 1> guest </option>
    </select>

    <input type= "checkbox" name = "add" value = "on">
    <input type= "checkbox" name = "edit" value = "on">
    <input type= "checkbox" name = "delete" value = "on">
    <input type= "checkbox" name = "view" value = "on">



    I want that when I select Guest onle checkboxes for "ADD" n "VIEW"
    should be shown and when Admin is selected all four.
    but I am able to find out how to access those elements in the form
    and change their properties.

    If someone could help me please.

    }

  2. #2
    SitePoint Guru momos's Avatar
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    919
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML:
    <input id="add" type="checkbox" value="on"/>

    Javascript:
    document.getElementById('add').style.display='none'; //hide it
    document.getElementById('add').style.display='inline'; //show it

  3. #3
    SitePoint Member ruddhim's Avatar
    Join Date
    Mar 2005
    Location
    India
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much.
    It solved my problem


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
  •