Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Javascript calendar pop-up

Featured Replies

I have downloaded and added a calendar pop up from www.softcomplex.com/products/tigra_calendar/ to my webpage. It calls a pop-up window with a calendar so a user can click a date and have it entered into the date field. But when the pop up is called, the window is created but then stops with this error:

"Not Implemented

The server does not support the functionality required to fulfill this request."

Is there something with the web companion that does not support this? Is there a way around this?

Thanks,

Mark Durgee

I've had a look at the calendar. It looks OK!

What are you submitting to FM?

Good Luck.

Garry

  • Author

Yeah the calendar looks cool, but I get errors when it "pops-up." This is using web companion (FMPro 6 PC, not Unlimited) and CDML format files.

I have calendar1.js and calendar2.js in my web directory.

[color:"blue"] <script language="JavaScript" src="calendar2.js"></script> is in the <head> section.

[color:"blue"] <a href="javascript:cal5.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a> is next to my date field.

[color:"blue"] <script language="JavaScript">

<!-- // create calendar object(s) just after form tag closed

// specify form element as the only parameter (document.forms['formname'].elements['inputname']);

// note: you can have as many calendar objects as you need for your application

var cal5 = new calendar2(document.forms['myform'].elements['DateIn']);

cal5.year_scroll = true;

cal5.time_comp = false;

//-->

</script>

Is just outside the form per instructions. I click on the little calendar icon next to my date field. It launches the pop up window. But the pop up window is filled with "Not Implemented. The server does not support the functionality required to fulfill this request"

Thanks,

Mark Durgee

I've made a slight adjustment to the "calendar2.js" file:

function cal_popup2 (str_datetime) {

this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value);

if (!this.dt_current) return;

var datetime = this.dt_current.valueOf() ;

var id = this.id ;

var obj_calwindow = window.open(

'calendar.html',

'Calendar', 'width=200,height='+(this.time_comp ? 215 : 190)+

',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes'

);

obj_calwindow.opener = window;

Here is the html/cdml of the edit page:

<!-- American format mm/dd/yyyy -->

<script language="JavaScript" src="calendar2.js"></script><!-- Date only with year scrolling -->

</head>

<body>

Hello World<br>

<form name="datefm" action="FMPro" method="post" target="_self">

<input type="hidden" name="-db" value="combotest.fp5">

<input type="hidden" name="-lay" value="web">

<input type="hidden" name="-format" value="hworld6.html">

<input type="hidden" name="-error" value="fmperror.html">

<input type="hidden" name="-recid" value="[FMP-CurrentRecID]">

Select Last Appointment Date (w/o year scrl.):<br>

<input type="Text" name="last_app" value="[FMP-Field: last_app]">

<a href="javascript:cal6.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>

<input type="submit" name="-edit" value="Edit">

</form>

<script language="JavaScript">

<!-- // create calendar object(s) just after form tag closed

// specify form element as the only parameter (document.forms['formname'].elements['inputname']);

// note: you can have as many calendar objects as you need for your application

var cal6 = new calendar2(document.forms['datefm'].elements['last_app']);

cal6.year_scroll = false;

cal6.time_comp = false;

//-->

</script>

</body>

Hope this helps.

Garry

  • 3 months later...

seems my last post got deleted in the mishap and I didn't get to see if there were any replies, so here it is again:

I'm wondering if it's possible to use this calendar a dynamic number of times per page; once per portal row. Anyone have an idea on how to implement that? thanks,

With this software you can have as many Calendar objects as you like. For example:

[FMP-Portal:myportal]

<input type="Text" name="myportal::mydate.[FMP-CurrentPortalRowNumber]" value="[FMP-Field: myportal::mydate]">

<a href="javascript:cal[FMP-CurrentPortalRowNumber].popup();"><img src="img/cal.gif"></a><br>

[/FMP-Portal]

<input type="submit" name="-edit" value="Submit Changes">

</form>

<script>

[FMP-Portal:myportal]

var cal[FMP-CurrentPortalRowNumber] = new calendar2(document.forms['datefm'].elements['myportal::mydate.[FMP-CurrentPortalRowNumber']);

cal[FMP-CurrentPortalRowNumber.year_scroll = false;

cal[FMP-CurrentPortalRowNumber.time_comp = false;

[/FMP-Portal]

</script>

This maybe similar to what you require.

All the best.

Garry

I've gotten very close with your help Garry, but I still have a small problem.

The calendars all pop-up, but the date I select always gets set to the field in the first row, rather than the row I clicked in.

All links and variables seem to be generating correctly. Each link looks like this after the page generates:

<input type="text" name="TheBookLines::RequiredDate.1" value="" size="8" style="text-align: center">&nbsp;<a href="javascript:cal1.popup();"><img src="img/cal.gif" border='0'></a>

<input type="text" name="TheBookLines::RequiredDate.2" value="" size="8" style="text-align: center">&nbsp;<a href="javascript:cal2.popup();"><img src="img/cal.gif" border='0'></a>

<input type="text" name="TheBookLines::RequiredDate.3" value="" size="8" style="text-align: center">&nbsp;<a href="javascript:cal3.popup();"><img src="img/cal.gif" border='0'></a>

etc.....

and at the end, here's what the second portal generates for declaring the variables:

<script>

var cal1 = new calendar2(document.forms['records'].elements['TheBookLines::RequiredDate.1']);

cal1.year_scroll = false;

cal1.time_comp = false;

var cal2 = new calendar2(document.forms['records'].elements['TheBookLines::RequiredDate.2']);

cal2.year_scroll = false;

cal2.time_comp = false;

var cal3 = new calendar2(document.forms['records'].elements['TheBookLines::RequiredDate.3']);

cal3.year_scroll = false;

cal3.time_comp = false;

var cal4 = new calendar2(document.forms['records'].elements['TheBookLines::RequiredDate.4']);

cal4.year_scroll = false;

cal4.time_comp = false;

var cal5 = new calendar2(document.forms['records'].elements['TheBookLines::RequiredDate.5']);

cal5.year_scroll = false;

cal5.time_comp = false;

var cal6 = new calendar2(document.forms['records'].elements['TheBookLines::RequiredDate.6']);

cal6.year_scroll = false;

cal6.time_comp = false;

</script>

(there happen to be 6 lines on this page)

<edit>

I should also mention that I made the changes you posted to calendar2.js

Also, I just found another problem...the calendar won't scroll through to the next or previous month. Any ideas?

</edit>

Any ideas on why all popups edit the first portal row? Thanks for the help so far!

I've just been testing it with a Portal and the same thing is happening to me.

I can't see anything obvious yet. However, I will keep looking.

Good Luck.

Garry

  • 2 weeks later...

Does anyone have any new developments on this issue?

Sorry, I haven't had much of a chance to do more investigation on this. This weekend I may have more time.

All the best.

Garry

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.