Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-28-2010, 07:53 AM   PM User | #1
richard-elland
New Coder

 
Join Date: Nov 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
richard-elland is an unknown quantity at this point
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.
richard-elland is offline   Reply With Quote
Old 01-28-2010, 06:44 PM   PM User | #2
Jazzo
Regular Coder

 
Jazzo's Avatar
 
Join Date: Apr 2008
Location: New York City
Posts: 164
Thanks: 20
Thanked 2 Times in 2 Posts
Jazzo is an unknown quantity at this point
Can you show us the actual code? Then, maybe we can help.
__________________
~Julian
14 y/o web developer, drummer, and Bridge player
Jazzo is offline   Reply With Quote
Old 01-28-2010, 07:06 PM   PM User | #3
richard-elland
New Coder

 
Join Date: Nov 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
richard-elland is an unknown quantity at this point
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>
richard-elland is offline   Reply With Quote
Reply

Bookmarks

Tags
hide, row, show, table, variable

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:20 AM.


Advertisement
Log in to turn off these ads.