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 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2009
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Show Hide Table row depending on a variable

    Hi
    I have a multipage form. I can put data entered in hidden form elements from previous pages. I want to show or hide table rows depending on this data value.
    For example, I collect a list of names in first form, but if some names are blank I dont want to show the table row associated with that name to collect more data.
    I have seen loads of code to toggle rows but cant find any which shows me how to toggle on a variable.
    Thanks in advance.

  • #2
    Regular Coder Jazzo's Avatar
    Join Date
    Apr 2008
    Location
    New York City
    Posts
    164
    Thanks
    20
    Thanked 2 Times in 2 Posts
    Can you show us the actual code? Then, maybe we can help.
    ~Julian
    14 y/o web developer, drummer, and Bridge player

  • #3
    New Coder
    Join Date
    Nov 2009
    Posts
    18
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I haven't written any code - that's what I'm asking for.
    Below are 2 table rows.
    I want to show the second row if $adult2fn is not empty.
    I can set $adult2fn as an hidden value elsewhere in the form.
    Thus
    Code:
    <input type="hidden" name="adult2fn" value="$adult2fn" />
    Code:
            
    <tr>
            <td width="189">$name $adult1sn</td>
            <td colspan="2">I agree to the membership conditions of DCN Ltd</td>       
            <td width="56"><input id="tick1id" name="tick1" type="checkbox" checked="checked" /></td>
        </tr>
    <tr>
            <td>$adult2fn $adult2sn</td>
            <td colspan="2">I agree to the membership conditions of DCN Ltd</td>       
            <td><input id="tick2id"  name="tick2" type="checkbox" checked="checked" ></td>
        </tr>


  •  

    Tags for this Thread

    Posting Permissions

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