Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Field auto completion on v4

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Locked
marcvander
Posts: 101
Joined: Mon Mar 26, 2018 5:57 pm

Field auto completion on v4

Unread post by marcvander »

Hey,

I recently opened a thread regarding field auto completion for v4, but it seems it has been deleted. In my v3, I could have a field auto completion working: https://forums.nubuilder.cloud/viewtopic.php?f=19&t=9459

But when trying it on the v4, the JQuery UI library was not loading when adding it in Setup -> Header. So I tried to add it directly in the JS of the form:
Capture d’écran 2018-05-06 à 22.38.36.png
And it works, now JQuery UI library is loading. But the issue is that it doesn't look good:
Capture d’écran 2018-05-06 à 22.39.50.png
In my v3 it looked way better:
Capture d’écran 2018-05-06 à 22.40.25.png
Any idea where that could come from ?

Thanks
You do not have the required permissions to view the files attached to this post.
Config:
nuBuilder v4 on a dedicated LAMP server:
-Ubuntu 14.04.5 LTS
-Apache 2.4.7
-MySQL 14.14 Distrib 5.7.22
-PHP 5.5.9-1ubuntu4.23
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Field auto completion on v4

Unread post by toms »

You need to include the css as well.

http://learn.jquery.com/jquery-ui/getting-started/
marcvander
Posts: 101
Joined: Mon Mar 26, 2018 5:57 pm

Re: Field auto completion on v4

Unread post by marcvander »

Yes indeed, somehow in the v3 it included it, but not in the v4. So for anyone interested in the answer, since I could not include JQuery UI in Setup -> Header (it did not load it), I included it directly in the form Javascript code. So under Custom Code, here is what I put:

Code: Select all

$.getScript("./jquery-ui-1.12.1.custom/jquery-ui.js", function() {
});

$('head').append('<link rel="stylesheet" type="text/css" href="./jquery-ui-1.12.1.custom/jquery-ui.min.css">');
Thanks toms !
Config:
nuBuilder v4 on a dedicated LAMP server:
-Ubuntu 14.04.5 LTS
-Apache 2.4.7
-MySQL 14.14 Distrib 5.7.22
-PHP 5.5.9-1ubuntu4.23
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Field auto completion on v4

Unread post by toms »

Could you check if this would work (Setup -> Header) ?

Code: Select all

</script>

<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<style>
    
</style>
If it works, you can replace the external links with local ones.
marcvander
Posts: 101
Joined: Mon Mar 26, 2018 5:57 pm

Re: Field auto completion on v4

Unread post by marcvander »

I tried, and it doesn't work, I still have the error: autocomplete is not a function

Here is how my Setup -> Header looks like:

Code: Select all

function nuHeaderTest() {

    console.log('Functions placed here before a closing script tag are available anywhere in nuBuilder Forte');

}

</script>
</script>

<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<style>
    
.1nuActionButton {background:#8dbef4;}
.1nuButton {background:#8dbef4;}

</style>
<script>
Config:
nuBuilder v4 on a dedicated LAMP server:
-Ubuntu 14.04.5 LTS
-Apache 2.4.7
-MySQL 14.14 Distrib 5.7.22
-PHP 5.5.9-1ubuntu4.23
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: Field auto completion on v4

Unread post by toms »

Your setup doesn't look like mine. So you tried mine and logged in again?
marcvander
Posts: 101
Joined: Mon Mar 26, 2018 5:57 pm

Re: Field auto completion on v4

Unread post by marcvander »

I didn't log out and log in again. After logging in again it worked. Thanks :)
Config:
nuBuilder v4 on a dedicated LAMP server:
-Ubuntu 14.04.5 LTS
-Apache 2.4.7
-MySQL 14.14 Distrib 5.7.22
-PHP 5.5.9-1ubuntu4.23
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Field auto completion on v4

Unread post by admin »

.
Locked