Results 1 to 5 of 5

Thread: Template for Tableless Form in Form Generator

  1. #1
    User
    Join Date
    06-19-09.
    Posts
    89

    Default Template for Tableless Form in Form Generator

    I'm looking for the file to edit to add a div class to the tableless layout in form generator. This is what I get after creating a form and choosing "Tableless"

    <label for="ctrl_10" class="mandatory"><span class="invisible">Mandatory field</span> First Name<span class="mandatory">*</span></label><input type="text" name="first_name" id="ctrl_10" class="text mandatory" value="" />

    <label for="ctrl_11" class="mandatory"><span class="invisible">Mandatory field</span> Last Name<span class="mandatory">*</span></label><input type="text" name="last_name" id="ctrl_11" class="text mandatory" value="" />


    What I would like to do is float these left so I can get a two column form created. My thought was to add div's around the labels and respective input fields, but I can't find where to do this?

    <div class="float_left"><label for="ctrl_10" class="mandatory"><span class="invisible">Mandatory field</span> First Name<span class="mandatory">*</span></label><input type="text" name="first_name" id="ctrl_10" class="text mandatory" value="" /></div>
    <div class="float_left"><label for="ctrl_11" class="mandatory"><span class="invisible">Mandatory field</span> Last Name<span class="mandatory">*</span></label><input type="text" name="last_name" id="ctrl_11" class="text mandatory" value="" /></div>

    Can anyone help?
    Thanks

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: Template for Tableless Form in Form Generator

    Create a new template for form_widget.tpl. I recently did this to get sliding labels to work. Here's the code I used:

    Code:
    <?php if (!$this->tableless): ?>
      <tr class="<?php echo $this->rowClass; ?>">
        <td class="col_0 col_first"><?php echo $this->generateLabel(); ?></td>
        <td class="col_1 col_last"><?php echo $this->generateWithError(); ?></td>
      </tr>
    <?php else: ?>
      <div class="slider">
      <?php echo $this->generateLabel(); ?> 
      <?php echo $this->generateWithError(); ?>
    
      </div>
    <?php endif; ?>

  3. #3
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Template for Tableless Form in Form Generator

    The form Generator has a field type "html code".
    Can't you just insert 3 of these in your form to wrap your fields?

    <div class="float_left">
    your firstname field
    </div><div class="float_left">
    your lastname field
    </div>

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Atlanta, Georgia
    Posts
    611

    Default Re: Template for Tableless Form in Form Generator

    I did just what ramjet mentioned on http://localdipity.com/contact.html. But the code from above automatically applied the div wrappers on the label and fields, as you can see at http://www.researchdesignassociates....v/contact.html.

  5. #5
    User
    Join Date
    06-19-09.
    Posts
    89

    Default Re: Template for Tableless Form in Form Generator

    Thanks Ben and ramjet, both of these solutions are working great! Thanks again

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
  •