Form Help

TOPIC:

Is this E-validation is possible ? If so, how ? 6 days 21 hours ago #243677

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
ah, I know why. Could you please export your form, zip and attach it here?
I made a small mistake that leads to this issue.

Upon export, please select only your form, nothing else. Thank you!

Please Log in or Create an account to join the conversation.

Is this E-validation is possible ? If so, how ? 5 days 3 hours ago #243727

  • Topic Author
  • Chabi01
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 176
  • Karma: 4
  • Thanks: 5
Hi Markus,
Here is the export.
Note : i leave my email address in the form, maybe we should remove this file from the board after you retrieve it (to avoid everybody to get my email address ?) ? But maybe i'm too much parano ;)

Thanks for all Markus :)
Xavier
Attachments:

Please Log in or Create an account to join the conversation.

Is this E-validation is possible ? If so, how ? 4 days 18 hours ago #243759

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9076
  • Karma: 167
  • Thanks: 737
Ok, please replace the entire before form piece code with this and let me know if that works:
if( isset( $_REQUEST['record_id'] ) && isset( $_REQUEST['password'] )) {

    if( $_REQUEST['password'] != 'abc' ){ return; }
    $cbJs = '';
    $db = JFactory::getDBO();
    $this->record_id = intval($_REQUEST['record_id'] );
    $db->setQuery("Select * From #__facileforms_subrecords Where record = " . $db->quote($this->record_id) . "");
    $recordEntries = $db->loadObjectList();
    $js = '';
    foreach ($recordEntries as $recordEntry) {
        switch ($recordEntry->type) {
            case 'File Upload':
                if (trim($this->formrow->template_code_processed) == 'QuickMode') {

                        $cbJs .= '
                        function ff_flashupload_not_empty(element, message)
                        {
                            if(typeof bfSummarizers == "undefined") { alert("Flash upload validation only available in QuickMode!"); return ""}
                            if(JQuery("#bfFlashFileQueue"+element.id.split("ff_elem")[1]).html() != "" || cbFlashElemCnt[element.id] != 0 ) return "";
                            if (message=="") message = "Please enter "+element.name+".\n";
                            ff_validationFocus(element.name);
                            return message;
                        }
                        ';

                    $cbOut = '';
                    $cbFiles = explode("\n", str_replace("\r", "", $recordEntry->value));
                    $i = 0;
                    $cnt = count($cbFiles);
                    $cbJs .= '
                                    cbFlashElemCnt["ff_elem'.$recordEntry->element.'"] = '.$cnt.';
                                ';
                    $cbDeac = '';
                    foreach ($cbFiles As $cbFile) {
                        if (trim($cbFile)) {
                            $cbOut .= '<div><input type=\"checkbox\" onchange=\"bfCheckUploadValidation(\'ff_elem'.$recordEntry->element.'\', this, \'ff_nm_'.$recordEntry->name.'[]\')\" value=\"1\" name=\"cb_delete_'.$recordEntry->element.'['.$i.']\" id=\"cb_delete_'.$recordEntry->element.'_'.$i.'\"/> <label style=\"margin-left: 5px; float: none !important; display: inline !important;\" for=\"cb_delete_'.$recordEntry->element.'_'.$i.'\">' . addslashes(basename($recordEntry->value)) . '</label></div>';
                            if($cbDeac == ''){
                                $cbDeac = 'bfDeactivateField["ff_nm_'.$recordEntry->name.'[]"]=true;'.nl();
                            }
                            $i++;
                        }
                    }
                    $js .= $cbDeac;
                    $js .= '
                                                    if (document.createTextNode){
                                                        if(!document.getElementById("bfFlashFileQueue' . $recordEntry->element . '")){
                                                           var mydiv = document.createElement("div");
                                                           mydiv.innerHTML = "<br/>' . $cbOut . '";
                                                           JQuery("#ff_elem' . $recordEntry->element . '_files").append(mydiv);
                                                        } else {
                                                           var mydiv = document.createElement("div");
                                                           mydiv.innerHTML = "' . $cbOut . '";
                                                           mydiv.innerHTML = "<br/>" + mydiv.innerHTML;
                                                           JQuery("#bfFlashFileQueue' . $recordEntry->element . '").after(mydiv);
                                                        }
                                                    }'.nl();
                }
                break;
            case 'Textarea':
            case 'Text':
            case 'Hidden Input':
            case 'Number Input':
            case 'Calendar':
                $js .= 'if(typeof JQuery != "undefined"){JQuery("[name=\"ff_nm_' . $recordEntry->name . '[]\"]").val("' . str_replace("\n", "\\n", str_replace("\r", "\\r", addslashes($recordEntry->value))) . '");if(typeof JQuery != "undefined")JQuery("[name=\"ff_nm_' . $recordEntry->name . '[]\"]").trigger("change");}else{';
                $js .= 'if(document.getElementById("ff_elem' . $recordEntry->element . '"))document.getElementById("ff_elem' . $recordEntry->element . '").value="' . str_replace("\n", "\\n", str_replace("\r", "\\r", addslashes($recordEntry->value))) . '";if(typeof JQuery != "undefined")JQuery(document.getElementById("ff_elem' . $recordEntry->element . '")).trigger("change");' . "\n";
                $js .= '}';
                break;
            case 'Checkbox':
                if (!empty($recordEntry->value)) {
                    $js .= 'if(document.getElementById("ff_elem' . $recordEntry->element . '") && !JQuery(document.getElementById("ff_elem' . $recordEntry->element . '")).attr("checked"))JQuery(document.getElementById("ff_elem' . $recordEntry->element . '")).click();' . "\n";
                }
                break;
            case 'Checkbox Group':
                $js .= '
                        for(var i = 0;i < document.ff_form' . $this->form . '.elements.length;i++){
                            if(document.ff_form' . $this->form . '.elements[i].type == "checkbox" && document.ff_form' . $this->form . '.elements[i].name == "ff_nm_' . $recordEntry->name . '[]" && document.ff_form' . $this->form . '.elements[i].value == "' . str_replace("\n", "\\n", str_replace("\r", "\\r", addslashes($recordEntry->value))) . '"){
                                if(typeof JQuery != "undefined" && !JQuery(document.ff_form' . $this->form . '.elements[i]).attr("checked")){
                                    JQuery(document.ff_form' . $this->form . '.elements[i]).click();
                                }
                            }
                        }' . "\n";
                break;
            case 'Radio Button':
            case 'Radio Group':
                $js .= '
                        for(var i = 0;i < document.ff_form' . $this->form . '.elements.length;i++){
                            if(document.ff_form' . $this->form . '.elements[i].type == "radio" && document.ff_form' . $this->form . '.elements[i].name == "ff_nm_' . $recordEntry->name . '[]" && document.ff_form' . $this->form . '.elements[i].value == "' . str_replace("\n", "\\n", str_replace("\r", "\\r", addslashes($recordEntry->value))) . '"){
                                if(typeof JQuery != "undefined" && !JQuery(document.ff_form' . $this->form . '.elements[i]).attr("checked")){
                                    JQuery(document.ff_form' . $this->form . '.elements[i]).click();
                                }
                            }
                        }' . "\n";
                break;
            case 'Select List':
                $js .= 'for(var i = 0; i < document.getElementById("ff_elem' . $recordEntry->element . '").options.length; i++){
                            if(document.getElementById("ff_elem' . $recordEntry->element . '").options[i].value == "' . str_replace("\n", "\\n", str_replace("\r", "\\r", addslashes($recordEntry->value))) . '"){
                                if(typeof JQuery != "undefined" && !JQuery(document.getElementById("ff_elem' . $recordEntry->element . '").options[i]).attr("selected")){
                                    JQuery(document.getElementById("ff_elem' . $recordEntry->element . '").options[i]).attr("selected", true).trigger("change");
                                }
                            }
                        }' . "\n";
                break;
        }
    }
    
    echo '
            <script type="text/javascript">
            <!--' . nl() . '
            var cbFlashElemCnt = new Array();
            function bfCheckUploadValidation(id, obj, deactivatable){
                if(obj.checked){
                    cbFlashElemCnt[id]--;
                }else{
                    cbFlashElemCnt[id]++;
                }
                if(cbFlashElemCnt[id] == 0){
                    bfDeactivateField[deactivatable]=false;
                }else{
                    bfDeactivateField[deactivatable]=true;
                }
            }
            '.$cbJs.'
            function bfLoadEditable(){
                ' . $js . '
            }
            
            JQuery(document).ready(function(){
                bfToggleFields("on","section","approval",bfDeactivateField);
                ff_getElementByName("record_id").value = '.json_encode($this->record_id).';
                ff_getElementByName("password").value = '.json_encode($_REQUEST['password']).';
                bfLoadEditable();
            });
            ' . nl() . '//-->
            </script>
            ' . nl();


}

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.047 seconds

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!