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.

Featured Replies

If someone could help me with this.

I have two databases DB1 and DB2.

I have an edit form using DB2.

Now I have made a HTML that enables me to 1] edit records in DB2 and going back to DB1 and redirect to another html page with a form that is based on records from DB1.

So i have two buttons : edit and back

But what i really want is one button that edits the record in DB2 and that redirects the browser to a HTML page "of" DB1.

What i could do is build a onload script that redirects the page after loading to DB1.

My question is: is there a syntax available that edits a record in DB2 and then automaticly redirects to DB1.

So in pseudocode what i want is :

FMPro?-DB=DB2&-lay=L2&-Format=LDB1.htm&-RecID=[FMP-CurrentToken]&-Edit"

Where L2 is the layout of DB2 and LDB1.htm a form page of DB1.

I know this code does not work because the format file must be based on DB2 (instead of DB1).

Any suggestions are welcome

Jitse

You could, as you say, use an onload within a transient page (this is a method I use). This page would contain a Form for submission. Or, you could use an Inline Action in the Format file.

All the best.

Garry

Not sure if this applies to your situation but I frequently use a redirect.htm page:

In the editing page you'd have

-db=db1, lay=cgi, format=redirect.htm, recid=[fmp-currentrecid],-edit

In the redirect.htm page you'd have

<meta http-equiv="refresh" content = "0;url=FMPro?-db=Db2&-error=err.htm&-format=Thepageyouwant.htm&-lay=cgi&-view">

The action of the redirect might also be changed into a -find passing the search parameter with a token

HTH

  • Author

thanks gary,

indeed i came up with the same solutions.

I had hoped for a more "intelligent" option

Jitse

Thanks

  • Author

This is what i have made.

I use a token to redirect the page and to limit the HTML page in case the browser needs to be redirected.

(*do not forget to pass the token when calling this page*)

(* i use Token.1 as a parameter *)

<BODY BGCOLOR="#FFFF33" onload="initpage()">

<SCRIPT LANGUAGE=javascript>

var i =0

function initpage(){

if ([FMP-CurrentToken:1]==1)

window.document.location.href="http://10.0.1.4/FMPro?-DB=webexpert&-lay=L2&-Format=M1Ebackup1.htm&-RecID=[FMP-CurrentToken:0]&-Edit"

}

function OKselect(){

var str1

var refstr

var v1

var v2

var v3

var v4

var v5

str1="http://10.0.1.4/FMPro?-DB=configuraties&-lay=L1&-Format=editconfig.htm&-RecID=[fmp-currentrecid]"

v1=window.document.myform.omschrijving.value

v2=window.document.myform.Q.value

v3=window.document.myform.V.value

refstr=str1+"&omschrijving="+v1+"&Q="+v2+"&V="+v3+"&-Token.0=[FMP-CurrentToken:0]&-Token.1=1&-edit"

window.document.location.href=refstr

}

function CANCELselect(){

window.document.location.href="http://10.0.1.4/FMPro?-DB=configuraties&-lay=L1&-Format=newconfig.htm&-RecID=[FMP-CurrentRecId]&-Token.0=[FMP-CurrentToken:0]&-Token.1=1&-Delete"

}

</SCRIPT>

[FMP-If: CurrentToken:1.eq.0]

<FORM name="myform">

<TABLE BORDER=1>

<TR>

<TD WIDTH=231>

<P>[FMP-FIELD: locatie]</P>

</TD>

<TD><INPUT TYPE=text NAME=omschrijving VALUE="[FMP-Field: omschrijving]" SIZE=30>

</TD>

</TR>

<TR>

<TD WIDTH=241>

<P><FONT SIZE="-1">Afvalwaterdebiet zuiveringsinstallatie

&#91;m^3/dag&#93</FONT></P>

</TD>

<TD WIDTH=227>

<P><INPUT TYPE=text NAME=Q VALUE="[FMP-Field:Q]" SIZE=30></P>

</TD>

</TR>

<TR>

<TD WIDTH=241>

<P><FONT SIZE="-1">Volume van AT &#91;m^3&#93</FONT></P>

</TD>

<TD WIDTH=227>

<P><INPUT TYPE=text NAME=V VALUE="[FMP-Field: V]" SIZE=30></P>

</TD>

</TR>

</TABLE>

</FORM>

<a href="#" onclick="OKselect()"><image src="OK.gif" height="30" border="0"></a>

<a href="#" onclick="CANCELselect()"><image src="CANCEL.gif" height="30" border="0"></a>

[/FMP-If]

</BODY>

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.