Apply date functiοn on text field

More
3 years 3 months ago - 3 years 3 months ago #102567 by MikeConom
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: 3 years 3 months ago by MikeConom.

Please Log in to join the conversation.

More
3 years 3 months ago #102597 by tpartner
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.

Please Log in to join the conversation.

More
3 years 3 months ago #102627 by MikeConom
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:

Please Log in to join the conversation.

More
3 years 3 months ago - 3 years 1 month ago #102631 by tpartner
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.
Last Edit: 3 years 1 month ago by tpartner.
The following user(s) said Thank You: MikeConom

Please Log in to join the conversation.