Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: apply timepicker to multiple textfields at once

apply timepicker to multiple textfields at once 1 Jahr 3 Monate her #90853

  • Gabriela
  • Gabrielas Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: apply timepicker to multiple textfields at once 1 Jahr 3 Monate her #90878

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: apply timepicker to multiple textfields at once 1 Jahr 3 Monate her #90879

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
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.
Letzte Änderung: 1 Jahr 3 Monate her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: apply timepicker to multiple textfields at once 1 Jahr 3 Monate her #90913

  • Gabriela
  • Gabrielas Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 64
  • Karma: 0
Thanks!! it works perfectly
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: apply timepicker to multiple textfields at once 1 Jahr 3 Monate her #90915

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 3844
  • Dank erhalten: 690
  • Karma: 330
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: apply timepicker to multiple textfields at once 1 Jahr 3 Monate her #90935

  • Gabriela
  • Gabrielas Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 64
  • Karma: 0
Have the feeling I will never be done... :blink:
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.151 Sekunden
Donation Image