Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: custom functions

custom functions 4 years 5 months ago #43058

  • sdaza
  • sdaza's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Does anyone know how to setup the template in order to use custom onload functions? What do I have to do?
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43064

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
This info is missing from the wiki in the current version and I noticed a lot of workarounds try to link to it. Maybe tpartner (being our javascript expert) can check and update the wiki.

You can find the info in an older revision:

docs.limesurvey.org/tiki-pagehistory.php...stom_onload_function
---
Menno Dekker
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43097

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6429
  • Thank you received: 839
  • Karma: 249
I see it here : docs.limesurvey.org/tiki-index.php?page=...stom_onload_function

No ?

ANd now with jquery , no need of custom_onload.
<script>
jQuery(document).ready(
function(){
alert('onload alert!');
}
);
</script>
directly in the survey
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43127

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
I agree with Shnoulle, you should now use the jQuery $(document).ready function. Nothing inside that function will get fired until the page is completely loaded.

I'll update the wiki when I get a chance.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43153

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6429
  • Thank you received: 839
  • Karma: 249
tpartner wrote:
I'll update the wiki when I get a chance.
You want to update ALL the javascript workarounds page :blink:

I can't help, i have more than half of wiki to translate in french (without the workarounds) :P

(and maybe there are update for jquery using, jquery-ui using for 1.9 version ... ;) )
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43185

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
You want to update ALL the javascript workarounds page
Ah, a new project!
and maybe there are update for jquery using, jquery-ui using for 1.9 version ...
I was under the impression that jQuery UI 1.9 was not going to be included anytime soon. Am I wrong?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43209

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
tpartner wrote:
I was under the impression that jQuery UI 1.9 was not going to be included anytime soon. Am I wrong?
I haven't heard about it. Do we need the new version?!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:custom functions 4 years 5 months ago #43244

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6429
  • Thank you received: 839
  • Karma: 249
It was on the admin screen.

Then we can use in template ({#TEMPLATEURL}../admin/jquery-ui/)

And do the css
:laugh:
The administrator has disabled public write access.

Re:custom functions 4 years 4 months ago #44108

  • treefit
  • treefit's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Does that mean that instead in inserting the following into a question:

<script type="text/javascript" charset="utf-8">
function Custom_On_Load(){

$(document).ready(function() {

This should work:


<script type="text/javascript" charset="utf-8">

function jQuery(){

$(document).ready(function() {


-Thanks
The administrator has disabled public write access.

Re:custom functions 4 years 4 months ago #44133

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
This will work:
<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function(){
 
        alert ('Hi there!');
 
    });
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 4 years 4 months ago by tpartner.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.181 seconds
Donation Image