Results 1 to 12 of 12
  1. #1
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Collapsing row with form
    I've got some tables (I did tables to speed things up for me) and I have one row that expands/collapses and it contains a form. When the row is visible, the column it's in gets stretched horizontally a bit.

    If I leave the form/table/labels and remove just the input and textarea elements, everything is fine.

    I've done this plenty of times without problems, but this is the first with a form included.

    Can anyone see what might be causing it to stretch out?

    Here's the main table:

    Code:
    <table width="100%" cellpadding="5" cellspacing="0" border="0">
       <tr>
         <td><b>Comments for "<?=$title;?>"</b></td>
       </tr>
    <?
    $query = mysql_query("select ...");
    if(mysql_num_rows($query) > 0) { 
       while() {
    ?>
       <tr>
         <td>
         <div>
         Comment by <b><?=$name;?></b> on <?=$newtime;?>
         <br />
         <div><?=$text;?></div>
         </div>
         </td>
       </tr>
    <?
       }
    } else {
    ?>
       <tr>
         <td>There are no comments for this post.</td>
       </tr>
    <? } ?>
    
    <?
    if($comment == "yes") {
    ?>
       <tr>
         <td>
         <a href="#" onclick="return toggle_collapse('expand0')">Comment on this post</a>
         </td>
       </tr>
        <tr id="collapseobj_expand0" style="display:none">
         <td>
    
         <form action="functions.php" method="post">
            <table cellpadding="3" cellspacing="0" border="0">
               <tr>
                 <td align="left">Display Name:</td>
                 <td><input type="text" size="20" /></td>
               </tr><tr>
                 <td align="left">Comments:</td>
                 <td><textarea rows="7" cols="40"></textarea></td>
               </tr>
            </table>
         </form>
    
         </td>
       </tr>
    <? } ?>
    </table>

    Shawn Kerr (.com) | Disney World | SEC Football

  2. #2
    ABW Ambassador MoneyBusiness's Avatar
    Join Date
    March 14th, 2006
    Posts
    2,051
    [humor me here] Have you tried to put your form tag outside of your main table declaration? I'm not sure this is it, but I remember having problems in the past when putting a form (the tag itself) within a table - it used to cause weird spacing, and such...sorry, but I don't even remember why it did it - it's been so long.

    Give it a shot and see what happens.
    Follow my dog, Maya, and I, as we fumble around the affiliate marketing world: www.MarketingMaya.com
    Recent Project: Cheap Personal Checks (using DigitalQuill)

  3. #3
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Yeah, I've tried that.

    I've rearranged this thing a bunch of different ways, and still with the same result.

    [edit] And I have the padding/margin set to 0 on the form, to kill any standard whitespace.

    Shawn Kerr (.com) | Disney World | SEC Football

  4. #4
    ABW Ambassador MoneyBusiness's Avatar
    Join Date
    March 14th, 2006
    Posts
    2,051
    Debugging spacing issues -mmmm mmmm, always fun.. If I can think of anything else, I'll let you know. Good luck!
    Follow my dog, Maya, and I, as we fumble around the affiliate marketing world: www.MarketingMaya.com
    Recent Project: Cheap Personal Checks (using DigitalQuill)

  5. #5
    Affiliate Manager MINDsprinter's Avatar
    Join Date
    August 18th, 2006
    Location
    Washington, DC
    Posts
    1,436
    Without your script to test with this will be hard, but maybe try setting some hard and fast widths with CSS or HTML?
    Jason Rosenbaum
    Affiliate Manager
    MINDsprinting

  6. #6
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    The javascript?

    Here's a URL to a page with comments, by the way (not live, don't want it crawled):

    shawnkerr.com/blog/id-10/

    When you click the "Comment on this post" link, it will show the form and stretch the column.

    The JS:

    Code:
    var is_regexp = (window.RegExp) ? true : false;
    function fetch_object(idname)
    {
    	if (document.getElementById)
    	{
    		return document.getElementById(idname);
    	}
    	else if (document.all)
    	{
    		return document.all[idname];
    	}
    	else if (document.layers)
    	{
    		return document.layers[idname];
    	}
    	else
    	{
    		return null;
    	}
    }
    
    function toggle_collapse(objid)
    {
    	if (!is_regexp)
    	{
    		return false;
    	}
    
    	obj = fetch_object('collapseobj_' + objid);
    	img = fetch_object('collapseimg_' + objid);
    	cel = fetch_object('collapsecel_' + objid);
    
    	if (!obj)
    	{
    		// nothing to collapse!
    		if (img)
    		{
    			// hide the clicky image if there is one
    			img.style.display = 'none';
    		}
    		return false;
    	}
    
    	if (obj.style.display == '')
    	{
    		obj.style.display = 'none';
    		if (img)
    		{
    			img_re = new RegExp("_collapsed\\.gif$");
    			img.src = img.src.replace(img_re, '.gif');
    		}
    		if (cel)
    		{
    			cel_re = new RegExp("^(expandedrow)(_collapsed)$");
    			cel.className = cel.className.replace(cel_re, '$1');
    		}
    	}
    	else
    	{
    		obj.style.display = '';
    		if (img)
    		{
    			img_re = new RegExp("\\.gif$");
    			img.src = img.src.replace(img_re, '_collapsed.gif');
    		}
    		if (cel)
    		{
    			cel_re = new RegExp("^(expandedrow)$");
    			cel.className = cel.className.replace(cel_re, '$1_collapsed');
    		}
    	}
    	return false;
    }

    Shawn Kerr (.com) | Disney World | SEC Football

  7. #7
    Affiliate Manager MINDsprinter's Avatar
    Join Date
    August 18th, 2006
    Location
    Washington, DC
    Posts
    1,436
    Tried the URL, I'm not seeing the comments section. If you can put up a live page I'd be happy to take a look at it for a few minutes.

    Here's a screenshot of what I see...
    Attached Images Attached Images
    Jason Rosenbaum
    Affiliate Manager
    MINDsprinting

  8. #8
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Damn, you happen to look at it during the 20 seconds I was messing with something.

    Bad timing there.

    Shawn Kerr (.com) | Disney World | SEC Football

  9. #9
    ABW Founder Haiko de Poel, Jr.'s Avatar
    Join Date
    January 18th, 2005
    Location
    New York
    Posts
    21,609
    Dumb suggestion but has worked for me in the past ... specify the text size of the input text (make it like 8pt).
    Continued Success,

    Haiko
    The secret of success is constancy of purpose ~ Disraeli

  10. #10
    Affiliate Manager MINDsprinter's Avatar
    Join Date
    August 18th, 2006
    Location
    Washington, DC
    Posts
    1,436
    The only shift I see in Safari is a shift because a scroll bar appears when the form appears. Otherwise it seems to be working perfectly.
    Jason Rosenbaum
    Affiliate Manager
    MINDsprinting

  11. #11
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Here's what I get in IE and FF:

    shawnkerr.com/comments.avi

    It's not a big thing, just rather annoying and I'd let to come up with a way to fix it.

    Changing text didn't make a difference. It's something about when only those 2 form elements are included, that it messes up. Or one or the other.

    Shawn Kerr (.com) | Disney World | SEC Football

  12. #12
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Ha! A simple nowrap attribute on the left column and a couple of "width" tweaks to the right side areas (changing a couple of tables from 100% to a fixed width) seems to have fixed it in both IE and FF.

    [edit] Well, there's a width problem in FF, but it looks and works right in every other browser I've checked (go figure) so it'll just have to look wrong in FF. I'm tired of having to fix things for FF (when they're coded correctly and validated to begin with).

    Shawn Kerr (.com) | Disney World | SEC Football

  13. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Alternatives to Vanity Row
    By JCrooks - AffiliateWindow in forum Affiliate Window Program Announcements
    Replies: 0
    Last Post: December 10th, 2014, 10:00 AM
  2. Collapsing datafeeds... Do I do it right?
    By soda in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: May 27th, 2010, 08:08 PM
  3. Datafeed Header Row
    By ocs94 in forum ShareASale - SAS
    Replies: 3
    Last Post: September 4th, 2006, 05:46 AM
  4. 5 days in a row
    By redsand in forum Commission Junction - CJ
    Replies: 10
    Last Post: March 29th, 2005, 08:10 PM
  5. Kazaa, Morpheus legal case collapsing
    By mousejockey in forum Suspicious Activity!
    Replies: 13
    Last Post: May 30th, 2002, 10:18 AM

Posting Permissions

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