CodeChargeMVP
Posts: 473
|
| Posted: 01/31/2011, 1:54 AM |
|
Hi,
�has anyone find a solution within the last 7 years for this thread?
http://forums.codecharge.com/posts.php?post_id=37470
I�ve been checking the forum if I already have posted this, but I haven�t found any.
Seems than this is a worldwide issue:
http://getsatisfaction.com/rollbase/topics/date_field_o...te_picker_popup
What I know So far:
the datepicker is an object as other different objects in javascript, this mean than is declared, has it own propertyes,methods and it should have it´s own events,
this is how it´s declared on the html view:
//Date Picker Object Definitions @1-31E8CBCA
var justgasto_DatePicker_JGFecha = new Object();
justgasto_DatePicker_JGFecha.format = "ShortDate";
justgasto_DatePicker_JGFecha.style = "Styles/Compact/Style.css";
justgasto_DatePicker_JGFecha.relativePathPart = "../";
justgasto_DatePicker_JGFecha.themeVersion = "3.0";
//End Date Picker Object Definitions
and this is the rest of the code:
<input id="justgastoJGFecha" onchange="ControlaDivisa();" value="{JGFecha}" maxlength="100" size="8" name="{JGFecha_Name}">
<!-- BEGIN DatePicker DatePicker_JGFecha -->
<span style="VISIBILITY: visible" id="DatePicker">
<a href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');" id="justgastoDatePicker_JGFecha">
<img id="justgastoDatePicker_JGFecha_Image" border="0" alt="Show Date Picker" src="../Styles/Compact/Images/DatePicker.gif"></a>
</span> <!-- END DatePicker DatePicker_JGFecha -->
You can see the input than receive the value which is selected from the datepicker, so I guess than the solution should be catch the event when the date is selected on the datepicker and than set the focus on the textbox which receives the value programmatically.
Thank you very much in advance.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 02/01/2011, 3:50 AM |
|
I�ve resolved it, if anyone is interested on the solution let me know and I�ll post it here.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
andrewi
Posts: 162
|
| Posted: 02/01/2011, 3:55 AM |
|
Please do. I thought that I'd done this once, but I realised that I had sidestepped the problem. The popup calendar must just set the value of the date text box directly, since it is passed the form and control names; so there's no event on the main page to tap into.
So it seemed to me that you'd either have to modify the popup calendar code itself (not tempting), or perhaps force the calendar to put its value into some other control or property by manipulating the arguments to showDatePicker(). Both seemed difficult.
How did you do it?
|
 |
 |
datadoit
|
| Posted: 02/01/2011, 7:08 AM |
|
You should never ask to share information. The primary purpose of a
forum is the share information. Post to 'tips and solutions'.
|
|
|
 |
CodeChargeMVP
Posts: 473
|
| Posted: 02/01/2011, 8:32 AM |
|
I´ll explain the idea of what I did, I think will be better than post just a peace of code:
We know than the date picker object has a text box besides which receives the date which we´ve selected on the date picker,so we want to know when the user has click on the date picker and than the text box has receive the value, that would be easy if the on change event would work but this not work since receiving the date from the date picker does not mean a change on the focus of this object.
So what I did was create a global variable called "initialdate" on the on load event from the form which contains the initial value from the text box which receives the value from the date picker.
So now on the "on blur event" from the text box which receives the value from the date picker, I run a function Called "ControlDate" which will compare the "initialdate" with the new value than has receive the text box from the datepicker.
If the variable "initialdate" is diferent from the variable "finaldate" that means than the user has click on the date picker and has choose a date.
If both variables are the same that means than the user has click on the date picker and has choose the same date than were already there.
The on blur event runs when an object lost his focus.
Obviously some other conditions should be done to set the code to every case.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
|