The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

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

TOPIC: apply timepicker to multiple textfields at once

apply timepicker to multiple textfields at once 4 months 1 week ago #90853

  • Gabriela
  • Gabriela's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • 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.

Re: apply timepicker to multiple textfields at once 4 months 1 week ago #90878

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2853
  • Thank you received: 423
  • Karma: 243
Have you included the timepicker plugin in your template?
Cheers,
Tony

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: apply timepicker to multiple textfields at once 4 months 1 week ago #90879

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2853
  • Thank you received: 423
  • Karma: 243
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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 4 months 1 week ago by tpartner.
The administrator has disabled public write access.

Re: apply timepicker to multiple textfields at once 4 months 1 week ago #90913

  • Gabriela
  • Gabriela's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • Karma: 0
Thanks!! it works perfectly
The administrator has disabled public write access.

Re: apply timepicker to multiple textfields at once 4 months 1 week ago #90915

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2853
  • Thank you received: 423
  • Karma: 243
Yeah, it's going to be quite a survey when you're done :cheer:
Cheers,
Tony

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: apply timepicker to multiple textfields at once 4 months 1 week ago #90935

  • Gabriela
  • Gabriela's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • Karma: 0
Have the feeling I will never be done... :blink:
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: DenisChenu, ITEd
Time to create page: 0.179 seconds
Donation Image