Forums

Hack: Slightly improved form layout

GreyHead 02 Jun, 2007
Hi,

I had quite a lot of text with one of my forms and found it helped my formatting to have a little more control over where the <form> tags were placed.

To do this I created {start_form} and {end_form} markers in the html tab in the admin section then hacked chronocontact.html.php showform() function like this:
 function showform( $rows , $imver )
{
    global $mosConfig_live_site;

    $paramsvalues = mosParseParams( $rows[0]->paramsall );
    if ( !empty($rows[0]->name) ){
        if ( !empty($rows[0]->scriptcode) ) {
            echo "<script type='text/javascript'>\n
                    //<![CDATA[\n".$rows[0]->scriptcode."//]]>\n
                    </script>\n";
        }
        if ( !empty($rows[0]->submiturl) ) {
            $actionurl = $rows[0]->submiturl;
        } else {
            $actionurl = 'index.php?option=com_chronocontact&task=send&chronoformname='
                .$rows[0]->name;
        }
        $form = "<form name='ChronoContact_".$rows[0]->name."' method='$paramsvalues->formmethod'
                action='$actionurl' ".$rows[0]->attformtag.">";
        $rows[0]->html = str_replace('{form_start}', $form, $rows[0]->html);
        $rows[0]->html = str_replace('{form_end}', '</form>', $rows[0]->html);
        $rows[0]->html = str_replace('{imageverification}', $imver, $rows[0]->html);
        echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
                <tr><td>";
        eval( "?>".$rows[0]->html );
        echo "</td></tr></table>";
?>


Bob

PS this is using v2.<br><br>Post edited by: GreyHead, at: 2007/06/04 20:08
Max_admin 04 Jun, 2007
Hi Bob,

nice idea but newbies already complain that the system is complicated and they need something easier, so lets keep thing as simple for them as possible and we can do our hacks !😉

thank you very much for the great work!!

Cheers

max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 04 Jun, 2007
Hi Max,

No problem - not really a suggestion but that there's no place here to post hacks😉

Bob
Max_admin 04 Jun, 2007
No worries, thank you! I have renamed it to "suggestion and hacks"

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.