Stretchwickster
Programmer
Hi there,
I've recently been getting to grips with HTML_QuickForm and have the basics sorted. What I'm looking to do is sneak in an anchor tag to appear immediately to the right of an input tag of type "file".
Currently, I use the following code to add the input tag to the form:
I'm using the following element template:
The above template works nicely for all but a few of the elements of my form. However, because the template wraps a table row around the input tag, I cannot insert the anchor tag where I want to. Ideally, I would like to be able to use a different element template just for a few items of the form e.g.
How would I go about achieving this?
By the way, in a css file I have made the input tag an inline element so that a line break won't exist between the input and anchor tags.
Your advice would be much appreciated!
Clive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
I've recently been getting to grips with HTML_QuickForm and have the basics sorted. What I'm looking to do is sneak in an anchor tag to appear immediately to the right of an input tag of type "file".
Currently, I use the following code to add the input tag to the form:
Code:
$form->addElement('file','pre-image-upload1','Upload pre-collection image:','class="image-upload" id="image-upload1"');
Code:
$renderer->setElementTemplate('
<tr valign="top">
<td class="sample-label">
{label}
</td>
<td class="sample-field">
<!-- BEGIN error --><span class="sample-error">{error}</span><br><!-- END error -->
{element}
<!-- BEGIN required --><span class="sample-required">*</span><!-- END required -->
</td>
</tr>');
Code:
$renderer->setElementTemplate('
<tr valign="top">
<td class="sample-label">
{label}
</td>
<td class="sample-field">
<!-- BEGIN error --><span class="sample-error">{error}</span><br><!-- END error -->
{element}[COLOR=red]{anchorTagGoesHere}[/color]
<!-- BEGIN required --><span class="sample-required">*</span><!-- END required -->
</td>
</tr>');
By the way, in a css file I have made the input tag an inline element so that a line break won't exist between the input and anchor tags.
Your advice would be much appreciated!
Clive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096