JitseSchaafsma Posted April 1, 2003 Share Posted April 1, 2003 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 Link to comment Share on other sites More sharing options...
Garry Claridge Posted April 1, 2003 Share Posted April 1, 2003 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 Link to comment Share on other sites More sharing options...
Pupiweb Posted April 1, 2003 Share Posted April 1, 2003 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 Link to comment Share on other sites More sharing options...
JitseSchaafsma Posted April 1, 2003 Author Share Posted April 1, 2003 thanks gary, indeed i came up with the same solutions. I had hoped for a more "intelligent" option Jitse Thanks Link to comment Share on other sites More sharing options...
JitseSchaafsma Posted April 2, 2003 Author Share Posted April 2, 2003 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 [m^3/dag]</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 [m^3]</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> Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7856 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now