Forum Replies Created
-
AuthorPosts
-
Sorry for being a pain. I appreciate the help.
Unfortuantly I can’t link to the page as I’m currently building the site on my computer locally using XAMPP. However I think I’m overcomplicating things here.
The page in question is a blank page created with the Enfold template. On that page I’ve added a ‘Code Block’ using the advanced editor in Enfold.In that code block I have placed the HTML as shown above which has created a text input on the page.
Now I’ve inserted the code Josue has provided into my custom.js script located in enfold-child/js/custom.js
However because I’m also using the code Elliot provided above at no point is the custom.js file being accessed (in my opinion though I’m quite a novice).Unfortunatly all these methods so far haven’t worked. Currently I’ve got:
-Elliots code in my function.php – which I’ve then wrapped my section of with the code supplied by Josue. (I’ll insert that code at the bottom of the post).
-The small bit of HTML in a code block on the required page.Just to further describe the situation here’s a section of the page showing the text field:
add_action( 'wp_footer', 'enfold_customization_custom_js' ); function enfold_customization_custom_js() { ?> <script type = "text/javascript"> (function(jQuery){ jQuery(window).load(function() { jQuery(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; jQuery( "#tags" ).autocomplete({ source: availableTags }); }); }); })(jQuery); </script> <?php }
Thanks :)
The code is just a simple autocomplete box, it can be seen in the jQuery demo page. Users start to type in and word and if matches any on the list it shows in a dropdown box.
Unfortunatly I’ve added that code to the functions.php in my child-theme folder, and it’s not working. This is the HTML i’m adding in the code block which is the text box that should auto complete.
<div class="ui-widget"> <label for="tags">Tags: </label> <input id="tags"> </div>
Also looking at the code you’ve provided, is that adding that code to the footer of every page? I don’t really need it on every page, just one.
Thanks for your help so far!
I’m also having trouble working out if I need to include any jquery ui files or if enfold has all the ones that are required.
-
AuthorPosts