- Posts: 31
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Apply date functiοn on text field
- MikeConom
- Topic Author
- Offline
- Junior Member
Less
More
10 years 4 months ago - 10 years 4 months ago #102567
by MikeConom
Apply date functiοn on text field was created by MikeConom
Hi
I am trying to apply in text field date function but is not working
Where is the rong:
I am trying to apply in text field date function but is not working
Where is the rong:
Code:
$(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: 10 years 4 months ago by MikeConom.
The topic has been locked.
- tpartner
- Online
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
10 years 4 months ago #102597
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on 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.
The topic has been locked.
- MikeConom
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
10 years 4 months ago #102627
by MikeConom
Replied by MikeConom on 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
i sent you the survey and i have put remarks in the place with my question
Thanks again for your response
Attachments:
The topic has been locked.
- tpartner
- Online
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
10 years 4 months ago - 10 years 2 months ago #102631
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on 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:
Here is your survey back with the amended code.
Placing this script in the source of the question will accomplish that:
Code:
<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: 10 years 2 months ago by tpartner.
The following user(s) said Thank You: MikeConom, haroldrio
The topic has been locked.
- haroldrio
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 2
4 years 8 months ago #187149
by haroldrio
Thank you for this.
I'm just a snippet hunter and I found out that you can move the rows further down by replacing the 2 or 3 and so on... on line
$('#question'+qID+' input[type="text"]:eq(1)').datepicker({
Replied by haroldrio on topic Apply date functiοn on text field
tpartner wrote: 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:Code:<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.
Thank you for this.
I'm just a snippet hunter and I found out that you can move the rows further down by replacing the 2 or 3 and so on... on line
$('#question'+qID+' input[type="text"]:eq(1)').datepicker({
The topic has been locked.