Welcome, Guest
Username: Password: Remember me

TOPIC: Apply date functiοn on text field

Apply date functiοn on text field 8 months 4 days ago #102567

  • MikeConom
  • MikeConom's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 1
  • Karma: 0
Hi

I am trying to apply in text field date function but is not working
Where is the rong:
$(document).ready(function() {
   var qID = {QID};
   var inputNum = 1;
 
$('#question'+qID+' li:eq('+(inputNum+6)+')').append($(function() { .datepicker({ dateFormat: "dd/mm/yy",changeMonth: true, changeYear: true })}););
 
});
</script>
Last Edit: 8 months 4 days ago by MikeConom.
The administrator has disabled public write access.

Apply date functiοn on text field 8 months 3 days ago #102597

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4117
  • Thank you received: 760
  • Karma: 346
Err...can you give us a better idea of what you are trying to do? What question type are you using and where is the "date" input positioned?
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.

Apply date functiοn on text field 8 months 3 days ago #102627

  • MikeConom
  • MikeConom's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 39
  • Thank you received: 1
  • Karma: 0
Thanks for your answer.
i sent you the survey and i have put remarks in the place with my question

Thanks again for your response
Attachments:
The administrator has disabled public write access.

Apply date functiοn on text field 8 months 3 days ago #102631

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4117
  • Thank you received: 760
  • Karma: 346
Okay, for the benefit of others, it seems that you want to apply a date-picker to the second text input of a multiple-short-text question.

Placing this script in the source of the question will accomplish that:
<script type="text/javascript" charset="utf-8">	
 
	$(document).ready(function(){
 
		var qID = {QID};
 
		// Apply the datepicker to the second text input
		$('#question'+qID+' input[type="text"]:eq(1)').datepicker({ 
			dateFormat: "dd/mm/yy",
			changeMonth: true, 
			changeYear: true 
		});
	});
</script>


Here is your survey back with the amended code.
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: 6 months 1 week ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: MikeConom
Moderators: ITEd
Time to create page: 0.122 seconds
Donation Image