Welcome, Guest
Username: Password: Remember me

TOPIC: apply timepicker to multiple textfields at once

apply timepicker to multiple textfields at once 1 year 3 months ago #90853

  • Gabriela
  • Gabriela's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 64
  • 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 1 year 3 months ago #90878

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3837
  • Thank you received: 687
  • Karma: 329
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.

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 1 year 3 months ago #90879

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3837
  • Thank you received: 687
  • Karma: 329
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.

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

Re: apply timepicker to multiple textfields at once 1 year 3 months ago #90913

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

Re: apply timepicker to multiple textfields at once 1 year 3 months ago #90915

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3837
  • Thank you received: 687
  • Karma: 329
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.

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 1 year 3 months ago #90935

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