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
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; ?>
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?
Quote:
<div class="float_left">
your firstname field
Quote:
</div><div class="float_left">
your lastname field
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.
Re: Template for Tableless Form in Form Generator
Thanks Ben and ramjet, both of these solutions are working great! Thanks again