1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Javascript with customized form default.php don't work

Discussion in 'Community' started by imagenweb, Jun 7, 2018.

  1. imagenweb

    imagenweb New Member

    Level: Community
    Hello everybody. I have an application that needs a customized form, I made tables and take the elements from the form in local variables to get order to the form (just like the tutorial said), but when I want to use the javascript it doesn?t work. I'd tried to customize the javascript code but still fail. I need help ?Does someone have an idea what can I do?
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    You must keep the "Fabrik structure" of the elements (HTML ids, CSS classes, surrounding DIVs with ids and classes etc)
     
  3. imagenweb

    imagenweb New Member

    Level: Community
    I think that this is my problem I made this:

    $date_time = $elements['date_time']->element;
    $id = $elements['id']->element;
    $idacademico = $elements['idacademico']->element;
    $num_doc_actividad = $elements['num_doc_actividad']->element;
    $descripcion_ac = $elements['descripcion_ac']->element;

    <table width="900" border="1">
    <tr>
    <td colspan="10" class="Contenido Celda">Si realiz? otras actividades institucionales describa cu?les y su forma de participaci?n.</td>
    </tr>
    <tr>
    <td width="44" class="Contenido">&nbsp;</td>
    <td width="840" colspan="9" class="Contenido"><?php echo $descripcion_ac; ?></td>
    <td class="Contenido" style="display:none;" >ID Acad?mico: <?php echo $idacademico; ?><?php echo $id; ?></td>
    </tr>
    </table>

    But i can't understand how can i assign a class or an id to the elements
     
  4. startpoint

    startpoint Active Member

    Level: Community
    This scenario is simple and can build only in Fabrik with the appropriate group settings.
    Try in your form group->tab repeat->template: table then in tab layout enter your columns and columns widths.
     
  5. imagenweb

    imagenweb New Member

    Level: Community
    In this example its so easy because I only use one element, but i have to make a lot of forms and someones has 30 elements in specific structure
     
  6. startpoint

    startpoint Active Member

    Level: Community
    Organize your form elements in groups then create your custom form template and organize these groups on your design.
    I use standard code from default template to show each group where I want.
    PHP:
        <div class="col-medium span4">
            <?php
                $group = $this->groups['YOUR-GROUP-NAME'];
                $this->group = $group;
            ?>
            <fieldset class="<?php echo $group->class; ?>" id="group<?php echo $group->id;?>" style="<?php echo $group->css;?>">
                <?php
                if ($group->showLegend) :?>
                    <legend class="legend"><?php echo $group->title;?><span class="icon-menu-2" style="font-size:24px;"> </span></legend>
                <?php
                endif;
                if (!empty($group->intro)) : ?>
                    <div class="groupintro"><?php echo $group->intro ?></div>
                <?php
                endif;
                ?>
                <div class="block-elements">
                <?php
                $this->elements = $group->elements;
                echo $this->loadTemplate($group->tmpl);
                ?>
                </div>
                <?php
                if (!empty($group->outro)) : ?>
                    <div class="groupoutro"><?php echo $group->outro ?></div>
                <?php endif; ?>
            </fieldset>
        </div>
    ?hus preserving the Fabrik structure.
    I don't know is this best and right way, but work for me.
     
    Last edited: Jun 8, 2018
  7. imagenweb

    imagenweb New Member

    Level: Community
    Thank you very much, It works. :D
     

Share This Page