Adjaime / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

javascript load multiple times in pfbc(PHP Form Builder Class - Imavex) #208

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
javascript load multiple times in pfbc(PHP Form Builder Class - Imavex) when we 
add elements which creates confliction in javascripts. it works fine when it 
load first time as it loads javascript once but when we close form popup and 
then again open form it again load javascript which creates javascipt conflict 
please give some solution or suggestion to resolve this problem. thanks in 
advance.

Original issue reported on code.google.com by deepa...@grene.in on 18 Nov 2013 at 7:16

GoogleCodeExporter commented 8 years ago
This may require a bit of hacking on the core files. The "renderJSFiles" 
function in Form.php is where you'll want to look. You can probably build onto 
the already existing "prevent" configuration attribute. So something like this:
protected function renderJSFiles() {
if (!in_array("javascriptFileIncludes", $this->prevent)) {//our new one line of 
code
            .....
        }
}

Then configure the form in your popups to not load javascript like this:
$form->configure(array(
    "prevent" => array("javascriptFileIncludes")
));

Note: this does assume any required javascript files have already been loaded 
somewhere else on the page. Also note that the above will prevent the .js files 
from loading, but any config related to the elements will still be rendered.

Original comment by pvcsnat...@gmail.com on 1 Feb 2014 at 2:57