October 2, 200223 yr I need to pass information to FileMaker, I have passed the information from a java applet to java script, but FileMaker does not seem to want the info...Kind of hurts my feelings. Here is the source code: <!-- saved from url=(0022)http://internet.e-mail --> <HTML> <HEAD> <TITLE>HTML file Title</TITLE> <script language="javascript"> function postInfo() { // get data from the applet uidStr = document.PWApplet.getUid() ; pwStr = document.PWApplet.getPw() ; // validate the data if (uidStr.length == 0) { alert("User Name cannot be blank.") ; return ; } if (pwStr.length == 0) { alert("Password cannot be blank.") ; return ; } // copy data from the applet into the hidden form document.info.uid.value = uidStr ; document.info.pw.value = pwStr ; // post the data from the form to FMPro document.info.submit() ; // tell the applet to clear its form document.PWApplet.clearForm() ; } </script> </HEAD> <BODY> <APPLET NAME="PWApplet" CODE="Password4.class" WIDTH=320 HEIGHT=200 MAYSCRIPT> </APPLET> <FORM> <INPUT type="button" value="SUBMIT" onClick="postInfo()"> </FORM> <FORM name="info" action="FMPro" method="Post" > <INPUT Type="hidden" Name="uid" value=""> <INPUT Type="hidden" Name="pw" value=""> </FORM> </BODY> </HTML> If someone would be so kind as to tell me what I need to do I would be very thankful! In Kindness Stephen K Knight Stephen Knight FM WebSchool www.fmwebschool.com
October 2, 200223 yr Stephen, The "info" form still needs other parameters: <FORM name="info" action="FMPro" method="Post" > <INPUT Type="hidden" Name="uid" value=""> <INPUT Type="hidden" Name="pw" value=""> <INPUT Type="hidden" Name="-db" value="mydatabase.fp5"> <INPUT Type="hidden" Name="-lay" value="mylayout"> <INPUT Type="hidden" Name="-format" value="myformat.html"> <INPUT Type="hidden" Name="-find" value=""> </FORM> Hope this helps. Garry
October 2, 200223 yr At first glance I'd say you need to include the -db, -lay, and -format inputs in your info form.
October 3, 200223 yr Author Thank you guys for all of your help...I did this: Here are a couple of things I modified: document.forms[0].username.focus() Here's how I reference a form (or a field in a form) with JavaScript: document.forms[0].info.submit() <FORM name="info" action="FMPro" method="Post"> <input type="hidden" name="-Lay" value="Layout #1"> <input type="hidden" name="-db" value="password.fp5"> <input type="hidden" name="-Format" value="login_succeed.html"> <input type="hidden" name="-Error" value="login_fail.html"> <input type="hidden" name="-op" value="eq"> <INPUT Type="hidden" Name="uid" value=""> <input type="hidden" name="-op" value="eq"> <INPUT Type="hidden" Name="pw" value=""> <Input Type="hidden" Name="find" value=""> </FORM> I didn't have time to investigate how to add the "-find" command. will it be necessary for this form to complete the login? Yet it still is missing a step I still get the database error 4
October 3, 200223 yr You're one character shy of perfection, from what I can see. Add a hyphen in front of Find, e.g. <input type="hidden" name="-Find">
October 3, 200223 yr And make sure you have "uid" and "pw" on the Layout "Layout #1". All the best. Garry
October 3, 200223 yr Just a note about the Javascript. You will need to use either: document.forms[1].submit() ; or document.info.submit() ; All the best. Garry
October 3, 200223 yr Author Got it to work. Of all people I should know I scoured and scoured my code, I had left the "-" off in front of my find. I looked at the code 100 times and didn't see it. Thank you to everyone that helped! The Applet and Java Script are working perfectly now. Thank you once again! Stephen
October 3, 200223 yr Funny... recently I was pulling my hair out trying to understand why a simple JavaScript wasn't working on one of my pages. As it happened I had used "If()" instead of "if()". I had nearly rewritten the entire code before I caught that one.
October 3, 200223 yr The "If()" has got me before as well; particularly swapping between ASP/VBScript and Javascript Garry
Create an account or sign in to comment