SEF URLs problem, Custom Server Side Validation

s.h 31 Mar, 2011
Hello!

I'm using Joomla! 1.6 and CF V4RC1.7. It's my first contact with both Joomla and CF, so I'm struggling a bit and particularly ran into the following problems:

I linked the form from a main menu item by adding an "External Link" - menu item linking to
index.php?option=com_chronoforms&chronoform=contact-form
(is this the way to do it?)

It works, but the menu item doesn't get marked as active when I'm on the form - I'm using SEF Urls via mod_rewrite, when I disable it, it gets marked correctly. Is there a way to fix this?

My second question is about the Custom Server Side Validation: Is there a way to output error messages?

Thanks in advance,

S.
GreyHead 31 Mar, 2011
Hi S.,

From the 'Help' tab; see the last bullet for error messages.

[list]

  • You should use PHP code with php tags.
  • Returning "boolean" false will fail, anything else or no return at all will lead to success.
  • Set fields errors by adding a new key => value entry to the $form->validation_errors array, where "key" is the "field name" and "value" is the "Error message", for example, if you want to set an error to the "email" field you should use this code
    $form->validation_errros['email'] = "Email error message is here.";
    .
  • [/list]


    Bob
    s.h 31 Mar, 2011
    :oops: I claim temporary blindness. Thanks a ton!

    I read there used to be a "Chrono Forms" menu item type, which would probably solve my problems - will it come back?

    S
    GreyHead 31 Mar, 2011
    Hi S,

    I have that afflication too.

    I expect that the menu items will come back as soon as Max has worked out how to get them to work correctly. In my experience so far the documentation for Joomla! 1.6 is still hard to find.

    Bob
    Max_admin 31 Mar, 2011
    Hi,

    I can create a new menu item of type "Chronoforms" fine here on my J1.6.1 installation, so creating menu items should work fine, I click the "select" button in the "Menu Manager: New Menu Item" page and the light box shows all possible options including "Chronoforms"

    Please show me a screenshot of yours if it doesn't work.

    Regards,
    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    s.h 01 Apr, 2011
    Wow, both of your response time is amazing!

    And Thanks! Everything works now🙂
    s.h 01 Apr, 2011
    Too joyous too early - the submit event doesn't get fired - the event settings from the menu item seem to overwrite the GET parameter.
    The form works if I set the menu to display the submit event, but then of course the validation displays errors when one first views the form. Is this a bug, a feature or did I overlook something again?

    //edit:
    I tried to circumvent the issue by adding an event which checks the GET parameter and loads the right event, however adding events doesn't work. The page gets dark, but the SqueezeBox doesn't appear. I get the following JS error instead:
    Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOM3Node.compareDocumentPosition]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: http://localhost/joomla/media/system/js/mootools-core.js :: <TOP_LEVEL> :: line 1"  data: no]


    Are there any problems with mootools on Joomla! 1.6.1 I'm not aware of?

    //edit2: Workaround
    I found a workaround: In the menu I chose "submit" as event. First thing in the submit event is a Custom Server Side Validation (code below) which loops to on Load if it fails.
    <?php
       return (isset($_GET['event']) && ($_GET['event'] == "submit"));
    ?>


    Kind regards,
    S
    Max_admin 01 Apr, 2011
    Hi S,

    This is a bug, please contact me for the patch file, or change line 34 at this file:
    /components/com_chronoforms/chronoforms.php

    from
    $event = $params->get('event');


    to
    if(empty($event)){
    		$event = $params->get('event');
    	}


    I will investigate more the JS error you got with new event creation.

    Regards,
    Max
    Max, ChronoForms developer
    ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
    ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
    s.h 01 Apr, 2011
    I changed it myself - works like a charm, thank you again!

    Edit regarding the JS Exception: It doesn't appear on google chrome, but it does appear in FFox4 and IE8 - haven't tested further.
    This topic is locked and no more replies can be posted.