- Posts: 14
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
HOW to Call JAVASCRIPT on submit button.
- manavaahuja07
- Topic Author
- Offline
- New Member
Less
More
6 years 11 months ago #150714
by manavaahuja07
HOW to Call JAVASCRIPT on submit button. was created by manavaahuja07
I want to call java-script on my submit button of survey.
I found little bit that its is called from here replacements_helper.php but i am not getting where should i put java-script and how to call that things i am new to php and limesurey.
I found little bit that its is called from here replacements_helper.php but i am not getting where should i put java-script and how to call that things i am new to php and limesurey.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
6 years 11 months ago #150742
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic HOW to Call JAVASCRIPT on submit button.
You don't need PHP for javascript ...
Look at jquery ....
And remind : the javascript must be done after submitting
Then something like this
You can replace too default limesurvey function github.com/LimeSurvey/LimeSurvey/blob/ma...urvey_runtime.js#L85
Look at jquery ....
And remind : the javascript must be done after submitting
Then something like this
Code:
$(document).on("click","#limesurveysubmitbtn", function(e){ e.preventDefault(); // Do what you want }
You can replace too default limesurvey function github.com/LimeSurvey/LimeSurvey/blob/ma...urvey_runtime.js#L85
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- manavaahuja07
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 1
6 years 11 months ago - 6 years 11 months ago #150765
by manavaahuja07
Replied by manavaahuja07 on topic HOW to Call JAVASCRIPT on submit button.
Where should i put this jquery by the way.
Last edit: 6 years 11 months ago by manavaahuja07.
The topic has been locked.
- markusfluer
- Visitor
6 years 11 months ago #150819
by markusfluer
Replied by markusfluer on topic HOW to Call JAVASCRIPT on submit button.
Best to put it in the help-text of a question.
But put it in source code view and inside of script tags.
You also need to be super admin to insert scripts into the question.
But put it in source code view and inside of script tags.
You also need to be super admin to insert scripts into the question.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
6 years 11 months ago #150923
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic HOW to Call JAVASCRIPT on submit button.
Since when do you need to be super admin to use Javacript in a question?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- markusfluer
- Visitor
6 years 11 months ago #150935
by markusfluer
Replied by markusfluer on topic HOW to Call JAVASCRIPT on submit button.
Current state:
You either need to be SuperAdmin, or have a SuperAdmin deactivate the XSS filter in the settings.
You either need to be SuperAdmin, or have a SuperAdmin deactivate the XSS filter in the settings.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
6 years 11 months ago #150936
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic HOW to Call JAVASCRIPT on submit button.
Never worked without activating the XSS filter. That's how every workaround with Javascript started in the old days. Deactivate XSS filter.markusfluer wrote: deactivate the XSS filter in the settings.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
6 years 11 months ago #150943
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic HOW to Call JAVASCRIPT on submit button.
Deactivated XSS-Filter, this is what I know. Your post sounded like it is ONLY possible if you are a Superadmin, which made me wonder. So all the same as before.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- manavaahuja07
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 1
6 years 11 months ago #151803
by manavaahuja07
Replied by manavaahuja07 on topic HOW to Call JAVASCRIPT on submit button.
OK Its work in my case Pro is sorted out.
But i want to put in "Lime survey code" not in survey que's Script.
So where should i put..?
But i want to put in "Lime survey code" not in survey que's Script.
So where should i put..?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
6 years 11 months ago #151816
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic HOW to Call JAVASCRIPT on submit button.
Best solution : register a script file on all Survey with beforeSurveyPage event.
Denis
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.