HTTP Request - Request Event

andyss 12 Jan, 2012
Hey guys, is there some trick to get the HTTP Request Action's 'Request Event' to work when set to onClick? I've set the 'Event Element ID' to the id of a button on my form, enabled the action and set the 'HTTP Request URL' to an event on another of my forms (index.php?option=com_chronoforms&chronoform=formname&event=newevent). I've even included the following 'Close' code in a Custom Code action of the called form:

<?php
$mainframe =& JFactory::getApplication();
$mainframe->close();
?>


Nothing happens when I click the button on my form. I'm trying to use this action to create a second 'submit' button on my form that fires a different event than the original submit button. (Hope that makes sense). Oh yeah, the action is in the onLoad event of the calling form.

As usual:
CFv4RC3 / J!1.7.3

Thanks again 😀
Andy
Max_admin 13 Jan, 2012
Hi Andy,

No tricks, all that looks fine to me, do you have Firefox with FireBug ? you can see the request triggered under the "Console", you can send me a link to the form to check it as well.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
andyss 13 Jan, 2012
Hey Max, here's the code that's added by the HTTP Request Action:

//
<![CDATA[
            var request_caller_10698 = function(){
                var myForm = $('chronoform_admin_edit_submissions');
                if(myForm.hasClass('hasValidation') == true){
                    myForm.set('send', {
                        url: 'http://www.mysite.com/index.php?option=com_chronoforms&chronoform=functions&event=test', 
                        method: 'post',
                        async: false,
                        onRequest: function(){
                            
                        },
                        onSuccess: function(responseText, responseXML){
                                                    },
                        onFailure: function(xhr){
                            
                        }
                    });
                    myForm.send('http://www.mysite.com/index.php?option=com_chronoforms&chronoform=functions&event=test');
                }
            }
            window.addEvent('domready', function() {
                                    $('testlink').addEvent('click', request_caller_10698);
                            });
        //]]>


I tested it on an a href link and get the following:

Form name can NOT be empty!


Nothing in the Firebug Console that I can see, requests or otherwise.

Andy
Max_admin 22 Jan, 2012
Hi Andy,

Sorry for not checking here sooner!

Could you please send me a link to the form so I can test it myself ? you can send it here or through the "Contact Us" page.

Regards,
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.