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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post

    Change Select Field

    Hey,
    I have this:

    Code:
    <table cellspacing="20">
    				<tr><th>Page</th><th>View</th><th>Change</th></tr>
    
    				<tr><td>Home</td><td><select name="1 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="1 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Hire System</td><td><select name="2 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="2 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Hire Catalogue</td><td><select name="4 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="4 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Main Settings</td><td><select name="5 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="5 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Customers</td><td><select name="6 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="6 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Add Settings</td><td><select name="7 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="7 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Parcel Services</td><td><select name="8 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="8 change"><option value="1" SELECTED>Can change</option><option value="0" >Can't change</option></select></td></tr><tr><td>Authentication</td><td><select name="9 view"><option value="1" SELECTED>Can view</option><option value="0">Can't view</option></select></td><td><td><select name="9 change"><option value="1" SELECTED>Can change</option><option value="0" SELECTED>Can't change</option></select></td></tr></table>
    How would I make is that when a for eg, 1 view = 0, 1 change is made to equal zero as well?

    Thanks

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,097
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Arrow Suggestions and questions ...

    Can you explain what you want to do a little more?

    Also, it is a little easier to view if you put the script between
    [ php] and [ / php] tags (without the spaces), like this:
    PHP Code:
    <html>
    <
    head>
    <
    title></title>
    </
    head>
    <
    body>

    <
    table cellspacing="20">
    <
    tr>
    <
    th>Page</th>
    <
    th>View</th>
    <
    th>Change</th>
    </
    tr>

    <
    tr>
    <
    td>Home</td>
    <
    td><select name="1 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select></td>

    <td>
    <td><select name="1 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select></td>
    </
    tr>

    <
    tr>
    <
    td>Hire System</td>
    <
    td><select name="2 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="2 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>

    <
    tr>
    <
    td>Hire Catalogue</td>
    <
    td><select name="4 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="4 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>

    <
    tr>
    <
    td>Main Settings</td>
    <
    td><select name="5 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="5 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>

    <
    tr>
    <
    td>Customers</td>
    <
    td><select name="6 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="6 change"><option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>

    <
    tr>
    <
    td>Add Settings</td>
    <
    td><select name="7 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td><td><select name="7 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>

    <
    tr>
    <
    td>Parcel Services</td>
    <
    td><select name="8 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="8 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>

    <
    tr>
    <
    td>Authentication</td>
    <
    td><select name="9 view">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="9 change">
    <option value="1" SELECTED>Can change</option>
    <option value="0" SELECTED>Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr>
    </
    table>
                    
    </
    body>
    </
    html
    Note also in you code you have a lot of unmatched <td></td> pairs
    and in the select name="9 change" (and the others)
    you should not have a space in the name
    nor should it start with a number (use name='change9' instead).
    and you have both options SELECTED.

    Finally, what is you JS question? I only see HTML code here.

  • #3
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post
    Thanks! So lets start here:

    PHP Code:
    <tr>
    <
    td>Parcel Services</td>
    <
    td><select name="view8">
    <
    option value="1" SELECTED>Can view</option>
    <
    option value="0">Can't view</option>
    </select>
    </td>

    <td>
    <td><select name="change8">
    <option value="1" SELECTED>Can change</option>
    <option value="0" >Can'
    t change</option>
    </
    select>
    </
    td>
    </
    tr
    So when view8 == 0, I want change8 to == 0 was well, on the fly.

    Thanks

  • #4
    Regular Coder
    Join Date
    Jan 2007
    Posts
    123
    Thanks
    20
    Thanked 1 Time in 1 Post
    Bump


  •  

    Posting Permissions

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