Quantcast
Channel: WordPress.org Forums » [Visual Form Builder] Support
Viewing all articles
Browse latest Browse all 2775

prtk on "[Plugin: Visual Form Builder] Add custom javascript file from local and internet?"

$
0
0

Hi

How would one add a javascript that refers to fields from a form?
I have added Javascript file that contains hardcoded ID of a field to enable a small function.
In addition to this file I would also like to add a script from a website.

I have looked into the scripts() function under visual-form-builder.php
So to do the above would I add the following lines to that scripts() function?

wp_register_script( 'my-JSfile', plugins_url('/js/my-JSfile.js', __FILE__ );
wp_enqueue_script( 'my-JSfile' );

wp_register_script( 'externalJS', plugins_url('http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=en-AU', __FILE__ );
wp_enqueue_script( 'externalJS' );

Would this work? How would one normally use custom JS to affect a form? Seems easy to apply custom styling to the form with CSS. But not sure about adding custom Javascript.
Thanks :-)

http://wordpress.org/plugins/visual-form-builder/


Viewing all articles
Browse latest Browse all 2775

Trending Articles