Issue 208 in php-form-builder-class: javascript load multiple times in pfbc(PHP Form Builder Class - Imavex)

4 views
Skip to first unread message

php-form-bu...@googlecode.com

unread,
Nov 18, 2013, 2:16:20 AM11/18/13
to php-form-builder...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 208 by deepa...@grene.in: javascript load multiple times in
pfbc(PHP Form Builder Class - Imavex)
http://code.google.com/p/php-form-builder-class/issues/detail?id=208

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.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

php-form-bu...@googlecode.com

unread,
Jan 31, 2014, 9:57:58 PM1/31/14
to php-form-builder...@googlegroups.com

Comment #1 on issue 208 by pvcsnat...@gmail.com: javascript load multiple
times in pfbc(PHP Form Builder Class - Imavex)
http://code.google.com/p/php-form-builder-class/issues/detail?id=208

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.
Reply all
Reply to author
Forward
0 new messages