asmaoui / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

dpSetSelected writes the passed date into textbox instead of only selecting it #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
-- 
1. Initialize datePicker
2. Set start date
3. Set selected date

What is the expected output?
-- 
When the date picker is next opened it should display the passed date, but 
should NOT write the date into the associated textbox

What do you see instead?
-- 
The date picker selects the passed date, but also writes it into the 
associated textbox

Please provide a URL to a page displaying the problem.
-- 
Sorry, i'm not able to provide a url, but i'll place a short piece of code 
at the end of this post.

What version of the datepicker are you using?
-- 
Version 2.1.2

On what operating system?
-- 
Windows XP SP 3

And Which Browser?
-- 
Internet Explorer 7.0.5730.13

Please provide any additional information below.
-- 
<html>
    <head>
        <script type="text/javascript" src="date.js"></script>
        <script type="text/javascript" src="jquery-
1.2.6.js"></script>
        <script type="text/javascript" src="jquery.datePicker-
2.1.2.js"></script>

        <link rel="stylesheet" href="datePicker.css" 
type="text/css" media="screen" />

        <script type="text/javascript">

            $.dpText = {
                TEXT_PREV_YEAR      :
    'Vorheriges Jahr',
                TEXT_PREV_MONTH     :
    'Vorheriger Monat',
                TEXT_NEXT_YEAR      :   'Nächstes 
Jahr',
                TEXT_NEXT_MONTH     :   'Nächster 
Monat',
                TEXT_CLOSE          :
    'Schliessen',
                TEXT_CHOOSE_DATE    :   'Datum 
auswählen'
            };

            Date.firstDayOfWeek = 1;
            Date.format = "ddmmyyyy";

            $(document).ready(function() {
                var objJQueryDatePicker = $("input
[name='myDate']").datePicker();
                objJQueryDatePicker.dpSetStartDate
("01011970");
                objJQueryDatePicker.dpSetSelected(new Date
().asString());
            });

        </script>
    </head>

    <body>
        <input type="text" name="myDate" value="" />
    </body>
</html>

Original issue reported on code.google.com by raffael....@gmail.com on 20 Jan 2009 at 5:05

GoogleCodeExporter commented 9 years ago
Hi,

I think that this is expected behaviour. dpSetSelected does the same as the user
clicking that date in the calendar. When the user clicks that date in the 
calendar
then the date is pushed into the text field.

Why do you not want the textfield to update? What use-case are you addressing?

Cheers,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 21 Jan 2009 at 5:05

GoogleCodeExporter commented 9 years ago
Hi Kelvin

I guess you are right. It was just confusing for me because in the last release 
(2.1.1), datePicker didn't behave like that. There i could select a date with 
the 
function dpSetSelected an it didn't write this value into the textfield.

It's too complicated for me to explain what i wanted to do in a foreign 
language 
(english), but i guess u're right. The new behaviour feels correct.

Raffael

Original comment by raffael....@gmail.com on 21 Jan 2009 at 9:13

GoogleCodeExporter commented 9 years ago
Hi Raffael,

Yes - I think it was a bug that I recently fixed. I'm sure there is a way that 
you
can prevent it from showing up (or maybe just set the value of the input to ''
immediately after creating the date picker) if you need to in your particular 
case.

But I think that the current behaviour of dpSetSelected is correct and should 
remain
like that,

Thanks,

Kelvin :)

Original comment by kelvin.l...@gmail.com on 21 Jan 2009 at 4:53

GoogleCodeExporter commented 9 years ago
Hi,

we are having the following issue.
In a grid we have start date, due date and completed date.

we have mentioned our list of scenarios below.

1) The first calender text box field I click on is blank.  The calendar opens 
with 
current date selected. supose I choose 11/01/09 and it is saved. 
2) The next field I click on is blank.  The calendar  should opens with 
11/01/09 
selected (the last date shown).  I select 11/05/09 and save my choice. 
3) The next field I click on already contains date 12/15/09.  The calendar 
opens 
with 12/15/09 selected (the value in the field).  I make no changes. 
The next field I click on is blank.  The calendar opens with 12/15/09 selected 
(this 
last date shown) 

please help us how we can acheive the above one

Original comment by venktes...@gmail.com on 10 Nov 2009 at 5:12

GoogleCodeExporter commented 9 years ago
This question isn't related to this issue. Please start a fresh issue if you 
want to
ask a fresh question.

Original comment by kelvin.l...@gmail.com on 10 Nov 2009 at 12:34