NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Niels Larsen on December 12, 2017, 02:24:30 AM

Title: Followup from NG "NTWS - Javascript - Update Control"
Post by: Niels Larsen 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
Title: Re: Followup from NG "NTWS - Javascript - Update Control"
Post by: Bruce 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
Title: Re: Followup from NG "NTWS - Javascript - Update Control"
Post by: Niels Larsen on December 13, 2017, 06:53:21 AM
The world is a great place to live.
Thanks!