Apply date functiοn on text field

More
3 years 11 months ago - 3 years 11 months ago #102567 by MikeConom
MikeConom created the topic: Apply date functiοn on text field
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 11 months ago by MikeConom.

Please Log in to join the conversation.

More
3 years 11 months ago #102597 by tpartner
tpartner replied the topic: Apply date functiοn on text field
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 11 months ago #102627 by MikeConom
MikeConom replied the topic: Apply date functiοn on text field
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 11 months ago - 3 years 10 months ago #102631 by tpartner
tpartner replied the topic: Apply date functiοn on text field
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 10 months ago by tpartner.
The following user(s) said Thank You: MikeConom

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!