Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

APPEND CUSTOM FIELDS FORMS AND FUNCTIONS

  • gbombonato
  • gbombonato's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 11 months ago #119917 by gbombonato
APPEND CUSTOM FIELDS FORMS AND FUNCTIONS was created by gbombonato
In a simple html form, i insert at Head one script containing several functions
At Body i create a form with several fields and some input fields, which call something like this: onClick="playAgain();"
Ok, Works fine
Function playAgain defined in my script is called when button is clicked

I can append code of that form to the end of a survey question page. Works fine.
I select "source" of any question and put the code there.

But function playAgain is not called when button is clicked
Where i must put script with functions to make buttons of added form have access to functions of my own script?

Can i insert one custom field inside limesurvey structure?
there is
<!-- START THE GROUP -->
...

<!-- PRESENT THE QUESTIONS -->
<div id="question642" class="numeric">
<table class="question-wrapper">
<tr>
<td class="questiontext">
<span class="qnumcode"> </span>texto q1<br /><span class="questionhelp"></span>

<span class="questionhelp" id="vmsg_642"><div id='vmsg_642_default' class='em_default emtip'>Apenas números podem ser usados nesse campo.</div>
</span>

</td>
</tr>
<tr>
<td class="answer">
<p class='question answer-item text-item numeric-item '> <label for='answer523946X80X642' class='hide label'>Resposta</label>
<input class='text numeric' type="text" size="10" name="523946X80X642" title="Apenas números podem ser usados nesse campo." id="answer523946X80X642" value="" onkeyup="fixnum_checkconditions(this.value, this.name, this.type,'onchange',0)" maxlength='20' />
</p>

</td>
</tr>
<tr>
<td class="survey-question-help">

</td>
</tr>
</table>
</div>

can i insert one custom field between limesurvey fields?
i tried some structure like above but nothing happened
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 11 months ago #119990 by tpartner
Replied by tpartner on topic APPEND CUSTOM FIELDS FORMS AND FUNCTIONS
You would normally add page-specific JavaScript to the source of any question on the page - manual.limesurvey.org/Workarounds:_Manip....29_in_LimeSurvey.3F

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose