Hack: Slightly improved form layout

Please post your suggestions or any hacks you have made here

Hack: Slightly improved form layout

Postby GreyHead on Sat Jun 02, 2007 10:07 pm

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:
Code: Select all
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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Slightly improved form layout

Postby admin on Mon Jun 04, 2007 5:13 pm

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
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
User avatar
admin
Platinum Boarder
 
Posts: 2127
Joined: Mon Aug 14, 2006 5:29 am

Re:Slightly improved form layout

Postby GreyHead on Mon Jun 04, 2007 5:32 pm

Hi Max,

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

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3251
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Slightly improved form layout

Postby admin on Mon Jun 04, 2007 11:00 pm

No worries, thank you! I have renamed it to "suggestion and hacks"

Cheers

Max
ChronoForms Developer Thanks for using ChronoForms.
If you have any problems with ChronoForms please tell us.
If you like ChronoForms please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
User avatar
admin
Platinum Boarder
 
Posts: 2127
Joined: Mon Aug 14, 2006 5:29 am


Return to Suggestions & Hacks

Who is online

Users browsing this forum: No registered users and 1 guest