JitseSchaafsma Posted July 29, 2003 Posted July 29, 2003 Thanks to gary i have been able to set up a HTML using iframe to create multiple records in one instance. This used to work fine when using the beta release of safari. Now that Apple has upgraded safari for beta to version 1.0, iframes do not appear to work anymore. Three topics i want too raise: 1]Has anyone enccountered problems with FM, CDML, Safari and iframes 2]Are their more generally adapted browsers that do no support iframes 3] in case of yes to Question two is their an easy way round to avoid using iframes but still being able to create multiple records without refreshing the HTML page ? The reason for my question is that i have come a long way in building my application, now with this iframe issues i feel leek i am in the middle of the stone ages again with my app. The other problem is that i am developing my app on a Mac. Thanks for any suggestions Jitse
JitseSchaafsma Posted July 29, 2003 Author Posted July 29, 2003 So, id did further experimenting with bot safari and IE 5.2.3. As said before: safari creates new windows when submitting a form to an iframe. Now with IE 5.2.3 it does not work either. This is what is happening: i have made a HTML page (newproject.htm) that contains two submit calls, one form and some iframes: The submit part document.forms[2].submit() alert("ready") delayMS() document.forms[2].submit() The form part<form action="FMPro" method="post" name="controls3" target="frame2"> <input type="hidden" name="-db" value="Projectmedewerkers.fp5"> <input type="hidden" name="-lay" value="L1"> <input type="hidden" name="-format" value="newproject.htm"> <input type="hidden" name="-error" value="newproject.htm"> <input type="hidden" name="ProjectId" value=[FMP-CurrentToken:5]> <input type="hidden" name="PersId" value=[FMP-CurrentToken:5]> <input type="hidden" name="uurtarief" value=[FMP-CurrentToken:5]> <input type="hidden" name="verkooptarief" value=[FMP-CurrentToken:5]> <input type="hidden" name="Urenbudget" value = "0"> <input type="hidden" name="-New"> </form> and the iframes: <iframe name="frame1" id="1" src="empty.htm"></iframe> <iframe name="frame2" id="2" src="empty.htm"></iframe> <iframe name="frame3" id="3" src="empty.htm" ></iframe> <iframe name="frame4" id="4" src="empty.htm"></iframe> Now the first submit does create a new record. However: the resulting pages can be seen in the iframe !! And the second submit is never called. I am stuck, can someone show the a working normal frame exeample? Thanks Jitse
Garry Claridge Posted July 29, 2003 Posted July 29, 2003 Maybe, you can try <div> tags, e.g. <div id="frame1"></div> I'm travelling at the moment and do not have a chance to experiment. Next wekk I will be back in the office. All the best. Garry
JitseSchaafsma Posted July 30, 2003 Author Posted July 30, 2003 Thanks, for the respond I was about to put in the subject Gary/Anatoli/other smart guys i need you badly. <smile> Today i will do some more experimenting including your option. Keep you posted on this one Travel savely Jitse
JitseSchaafsma Posted July 30, 2003 Author Posted July 30, 2003 So i stripped down the code to this <SCRIPT LANGUAGE=javascript> function createproject(){ document.forms[0].submit() alert("test") document.forms[0].submit() } </SCRIPT> <input type="image" SRC="btn_send_on.gif" onclick="createproject()"> <form action="FMPro" method="post" name="controls3" target="frame1"> <input type="hidden" name="-db" value="test.fp5"> <input type="hidden" name="-lay" value="L1"> <input type="hidden" name="-format" value="testpage.htm"> <input type="hidden" name="-error" value="testpage.htm"> <input type="hidden" name="-New"> </form> </CENTER> <iframe name="frame1" id="1" height="0" width="0"></iframe> How it should work : two records created and no update of the (parent) window nor creation of new window. These are the results: Safari create a new empty page after the first submit, it only creates one record. Mozilla does create two records, no additional windows created. IE on mac : one record created, no additional window created !! Internet explorer on windows platform creates two record, no addiotional windows created Why does safari create two windows and creates only one record (* i am using FM 5.5 on OS 9.2.2 *) Any researchers out there ? Thanks Jitse
JitseSchaafsma Posted July 30, 2003 Author Posted July 30, 2003 I wish i could make money with experimenting: In case of mozilla (OS X) and i replace the alert with a timedelay (10 secs), only one record is created !! So i need the alert to tell filemaker to create a record. Very strange behaviour. Jitse
JitseSchaafsma Posted July 30, 2003 Author Posted July 30, 2003 OK, i am completely lost. Please check the code in theis message. I duplicated the form (they both create a new record in the same iframe) I have done some parameter analyses scenario 1 document.forms[0].submit() delayMS() document.forms[0].submit() delayMS() document.forms[0].submit() Only one record created scenarion 2 document.forms[0].submit() delayMS() document.forms[1].submit() delayMS() document.forms[0].submit() Three records created !! What does this mean : Jitse <SCRIPT LANGUAGE=javascript> function delayMS() { var localtime= new Date() var localtimeMS=localtime.getTime() var timedelayMS=localtimeMS+400 var currenttime=new Date() var currenttimeMS=currenttime.getTime() while (currenttimeMS<timedelayMS) { currenttime=new Date() currenttimeMS=currenttime.getTime() } } function createproject(){ document.forms[0].submit() delayMS() document.forms[0].submit() delayMS() document.forms[0].submit() } </SCRIPT> <input type="image" SRC="btn_send_on.gif" onclick="createproject()"> <form action="FMPro" method="post" name="controls3" target="frame1"> <input type="hidden" name="-db" value="test.fp5"> <input type="hidden" name="-lay" value="L1"> <input type="hidden" name="-format" value="testpage.htm"> <input type="hidden" name="-error" value="testpage.htm"> <input type="hidden" name="-New"> </form> <form action="FMPro" method="post" name="controls4" target="frame1"> <input type="hidden" name="-db" value="test.fp5"> <input type="hidden" name="-lay" value="L1"> <input type="hidden" name="-format" value="testpage.htm"> <input type="hidden" name="-error" value="testpage.htm"> <input type="hidden" name="-New"> </form>
JitseSchaafsma Posted July 30, 2003 Author Posted July 30, 2003 I am going to catch up with gary !! This code creates two records as it should function createproject(){ document.forms[0].target="frame1" document.forms[0].submit() delayMS() document.forms[0].target="frame1" document.forms[0].submit() } so by telling the form what frame to target to it seems to work (at least mozilla, safari still creates a new window ) Jitse
Leb i Sol Posted July 30, 2003 Posted July 30, 2003 target="frame1" target thing: ======================================================================== _blank opens the linked document in a new browser window, leaving the current window untouched. _parent opens the linked document in the parent frameset of the frame the link appears in, replacing the entire frameset. _self opens the link in the current frame, replacing the content in that frame. _top opens the linked document in the current browser window, replacing all frames. Tip: If you
JitseSchaafsma Posted July 30, 2003 Author Posted July 30, 2003 Thanks for your respond. However one of the issues is why the submits after each other do not work unless you actually provided the target with a javascript statement instead of "hardcode". In addition could you provide me with a sample code that shows me how to submit a form using frameset and frames. For example, how should the previous simple example be build using frames? Thanks Jitse
Leb i Sol Posted July 30, 2003 Posted July 30, 2003 hm ...how about changing: <input type="image" SRC="btn_send_on.gif" onclick="createproject()"> <form action="FMPro" method="post" name="controls3" target="frame1"> into: <form action="FMPro" method="post" name="controls3" target="_blank" onSubmit="createproject();"> .... .. <input name="Submit" type="image" value="Submit" src="btn_send_on.gif" width="45" height="20"> All the best!
Recommended Posts
This topic is 7863 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