Jump to content
Sign in to follow this  
Elderberg

Date Range on Submission Form

Recommended Posts

I'm looking for javascript sample that would allow me to restrict my users to only be able to select between yesterdays, current date, and tomorrows date when using the calendar popup.  

 

Share this post


Link to post
Share on other sites

Hi @Elderberg,

I can suggest using a simple Dropdown or Listbox for date selection and a lookup table which will be updated via Tasks on daily basis.

Here is an example of Task which adds yesterdays, current date, and tomorrows date on daily basis.

qQwNWlw.png

You may also import this Task from attached archive.

Hope this helps.

Regards,

vitalikssssss

CaspioData_2019-Dec-02_1638.zip

Share this post


Link to post
Share on other sites
9 hours ago, Vitalikssssss said:

Hi @Elderberg,

I can suggest using a simple Dropdown or Listbox for date selection and a lookup table which will be updated via Tasks on daily basis.

Here is an example of Task which adds yesterdays, current date, and tomorrows date on daily basis.

qQwNWlw.png

You may also import this Task from attached archive.

Hope this helps.

Regards,

vitalikssssss

CaspioData_2019-Dec-02_1638.zip 3.32 kB · 1 download

Good Stuff, i changed timestamp to date and got it to work.  Its an interesting work around which i'll consider.  it solves one challenge and creates others. :) but thank you kindly.

Share this post


Link to post
Share on other sites

Hey Vitalikssssss,

I implemented your suggestion using a Dropdown box.  Previously I had a VirtualField configured as a TextField with calendar pop up enabled. 

Below are two lines of code which i used previously when the field was a TextField.  Can you advise how I would 1.) assign v_DateOnlyStamp as a value to the dropbox  2.) pass the selected value of the dropbox to a variable.  

// Assign Current Date 
document.getElementById('cbParamVirtual1').value=v_DateOnlyStamp;

//  pass value to variable
var date = document.getElementById('cbParamVirtual1').value;

Share this post


Link to post
Share on other sites

I realize the Task creates the dates as a Date Object..  i think i need it to be saved as a String.  I was unsuccessful in my attempt to modify your Task.  Can you advise if this is possible? 

Share this post


Link to post
Share on other sites
14 hours ago, geoffdude said:

Is "Loops" even available for tasks anymore? I don't see it.

Hi @geoffdude,

It is available in 20.0 Caspio Bridge version.

Probably your site has not been updated yet to 20.0 Caspio Bridge version.

You can check your Caspio Bridge version within your account: from the top menu bar HELP --> About Caspio Bridge.

Also, you can check Caspio Twitter for latest information about system updates.

Regards,

vitalikssssss

Share this post


Link to post
Share on other sites
10 hours ago, Elderberg said:

I realize the Task creates the dates as a Date Object..  i think i need it to be saved as a String.  I was unsuccessful in my attempt to modify your Task.  Can you advise if this is possible? 

Hi @Elderberg,

I am not sure why you need Date to be saved as String, but anyway you can simple change the datatype for the field "Date".

Regards,

vitalikssssss

 

Share this post


Link to post
Share on other sites
10 hours ago, Elderberg said:

Hey Vitalikssssss,

I implemented your suggestion using a Dropdown box.  Previously I had a VirtualField configured as a TextField with calendar pop up enabled. 

Below are two lines of code which i used previously when the field was a TextField.  Can you advise how I would 1.) assign v_DateOnlyStamp as a value to the dropbox  2.) pass the selected value of the dropbox to a variable.  

// Assign Current Date 
document.getElementById('cbParamVirtual1').value=v_DateOnlyStamp;

//  pass value to variable
var date = document.getElementById('cbParamVirtual1').value;

What is the purpose of this script? 

Sorry, it does not make any sense to me.

Regards,

vitalikssssss

Share this post


Link to post
Share on other sites
8 hours ago, Vitalikssssss said:

Hi @geoffdude,

It is available in 20.0 Caspio Bridge version.

Probably your site has not been updated yet to 20.0 Caspio Bridge version.

You can check your Caspio Bridge version within your account: from the top menu bar HELP --> About Caspio Bridge.

Also, you can check Caspio Twitter for latest information about system updates.

Regards,

vitalikssssss

I'm on 20.3 .. strange huh?

Update: I had to clear my cache to see the new version changes. It's all good now.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...