Drupal 7 form template issue [resolved]

I have create a template for my form, and ran into an issue with elements getting rendered twice.

With this code...

<div id="filterContainer" style="width: 100%">
    
    <?php
    if(!empty($form['filters'])) {
        
        foreach($form['filters'] as $formFilter) {
            echo '<div style="float: left;">';
            echo drupal_render($formFilter);
            echo '</div>';
        }
        
    }
    ?>
    
</div>

<?php
    print drupal_render_children($form);
?>

all the elements within $form['filters'] get rendered a 2nd time when drupal_render_children is called, and drupal throws a few errors. The errors are...
Warning: Invalid argument supplied for foreach() in element_children() (line 6046 of /home/attabsngardner/public_html/includes/common.inc).
Warning: Cannot use a scalar value as an array in drupal_render() (line 5612 of /home/attabsngardner/public_html/includes/common.inc).
Warning: Cannot use a scalar value as an array in drupal_render() (line 5667 of /home/attabsngardner/public_html/includes/common.inc).

If I change the foreach to use reference, like so... (notice the & before $formFilter)

 foreach($form['filters'] as &$formFilter) {
            echo '<div style="float: left;">';
            echo drupal_render($formFilter);
            echo '</div>';
}

Create a jquery showcase with views

Hello everybody,

I'm getting there with views-slideshows and I'm amazed by the possibilities it offers.

Still, since we're never there, a client wants me to create his showcase-website, what is perfectly doable, but ...
he visited the website www.pentagram.com and that's what he wants.

Possible??

customizing regions

im trying to customize specific regions of pages
blocks do not go far enuf for wht i want to do

are we able to edit .tpl for say, header or footer?
i'm working with zen theme

also, is there a link for things like the sign in page?
this might be useful if i want to access it thru a shadow box or similar

thnx

AJAX checkbox trigger

Hi there,

I've got a checkboxes list element in a my custom form.
This list has an ajax attribute.
Can i trigger this ajax function with the checking of a specific checkbox in this list?
I tried to use the 'trigger_as' attribute but didn't get it to work!
By the way, #tree == TRUE in my form.
This is my code:

I am looking for an email marketing module

We have a couple of clients that would like to use their user list to market. Are there any modules that are organized for marketing without depending on the API of an outside service?

Some of the features needed.

Create new table containing other fields for user profile

Hello everybody,

I'm trying to add to the user profile a field that is a table. In the first column there is going to be something chosen from a list, the second and third columns will be text, further down there is a checkbox, etc..

I have been looking into groupfields but it doesn't seem to do the job, does anyone have any suggestion regarding where I should be looking?

Thank you,

David

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x