Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: apply timepicker to multiple textfields at once

apply timepicker to multiple textfields at once 3 years 8 months ago #90853

  • Gabriela
  • Gabriela's Avatar
  • Offline
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 0
Hi all

trying to apply timepicker function to various answer fields, using just one function code...

no java knowledge, I tried this but not working..

$(document).ready(function(){

var answerArray="#answer97841X5X16SQ001_SQ002,#answer97841X5X16SQ002_SQ002,#answer97841X5X16SQ003_SQ002".split(',');


$(answerArray).timepicker({
timeText: 'Hora',
hourText: 'hora',
minuteText: 'minutos',
closeText: 'Fechar'

});



$(answerArray).attr('readonly', 'readonly');


});
</script>

Please, can you explain what im doing wrong?

thanks.
The administrator has disabled public write access.

apply timepicker to multiple textfields at once 3 years 8 months ago #90878

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6323
  • Thank you received: 1407
  • Karma: 547
Have you included the timepicker plugin in your template?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

apply timepicker to multiple textfields at once 3 years 8 months ago #90879

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6323
  • Thank you received: 1407
  • Karma: 547
If you have included the plugin (fgelinas.com/code/timepicker/), try this:
$(document).ready(function(){
	var timeAnswers =$('#answer97841X5X16SQ001_SQ002, #answer97841X5X16SQ002_SQ002, #answer97841X5X16SQ003_SQ002');
 
	$(timeAnswers).timepicker({
		timeText: 'Hora',
		hourText: 'hora',
		minuteText: 'minutos',
		closeText: 'Fechar'
	}).attr('readonly', 'readonly');
});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 8 months ago by tpartner.
The administrator has disabled public write access.

apply timepicker to multiple textfields at once 3 years 8 months ago #90913

  • Gabriela
  • Gabriela's Avatar
  • Offline
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 0
Thanks!! it works perfectly
The administrator has disabled public write access.

apply timepicker to multiple textfields at once 3 years 8 months ago #90915

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6323
  • Thank you received: 1407
  • Karma: 547
Yeah, it's going to be quite a survey when you're done :cheer:
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

apply timepicker to multiple textfields at once 3 years 8 months ago #90935

  • Gabriela
  • Gabriela's Avatar
  • Offline
  • Senior Lime
  • Posts: 64
  • Thank you received: 1
  • Karma: 0
Have the feeling I will never be done... :blink:
The administrator has disabled public write access.
Time to create page: 0.274 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form