NetTalk Central

Author Topic: Followup from NG "NTWS - Javascript - Update Control"  (Read 4220 times)

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Followup from NG "NTWS - Javascript - Update Control"
« on: December 12, 2017, 02:24:30 AM »
Hi Bruce

Just want to followup on my question from the NG.
Example attached.


From: "Bruce Johnson" <bruce.johnson@Nospamcapesoft.com>
Subject: Re: NTWS - Javascript - Update Control
Date: 28 Nov 2017 06:45:32 -0500
Message-ID: <A921.1511869532.578@discuss.softvelocity.com>
Lines: 1

I'll need an example to play with Niels.

cheers
Bruce

"Niels Larsen"  wrote in message news:A921.1511861397.568@discuss.softvelocity.com...

Hi

I call the datepicker from af div. This gives me the possibility to
make the calendar appears inline. I can easyli store the date in a
sesioon var, but how do I update my date control from JS?
This is my code:

 <script>
$(document).ready(function() {
   $('#datepicker').datepicker( {
    onSelect: function(date) {
       SetSessionValue('loc:dato',date);

   Uodate data control.........



    },
   selectWeek: true,
   inline: true,
   startDate: '01/01/2000',
   firstDay: 1,
   dayNamesMin:['S?n','Man','Tir','Ons','Tor','Fre','L?r'],
   monthNames: [ 'Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni',
'Juli', 'August', 'September', 'Oktober', 'November', 'December' ],
  showWeek: true,
  weekHeader: 'Uge',

 });
});
 </script>


Regards Niels

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Followup from NG "NTWS - Javascript - Update Control"
« Reply #1 on: December 13, 2017, 01:47:54 AM »
Hi Niels,

Your OnSelect function would look something like this;

onSelect:function(date){$("#loc__date").val(date).change();}})

That said, I've added a feature to build 10.14 so that you can simple add a date lookup to the form as normal, but tick on a checkbox "Inline Lookup". So that's the easier way to go.

cheers
Bruce

Niels Larsen

  • Sr. Member
  • ****
  • Posts: 431
    • View Profile
    • Email
Re: Followup from NG "NTWS - Javascript - Update Control"
« Reply #2 on: December 13, 2017, 06:53:21 AM »
The world is a great place to live.
Thanks!