pcottrell Posted April 5, 2001 Posted April 5, 2001 I have been trying to submit a form action (-find) using a link instead of a button. The suggested method of javascript sounds right, but I am getting error messages.. Here is what I am doing so far... <P><FORM ACTION="FMPro" METHOD="post" name="newsform"> <P><INPUT TYPE="hidden" NAME="-DB" VALUE="newsandevents"> <INPUT TYPE="hidden" NAME="-Lay" VALUE="web"> <INPUT TYPE="hidden" NAME="-format" VALUE="search_results.htm"> <INPUT TYPE="hidden" NAME="-error" VALUE="search_error.htm"> <INPUT TYPE="hidden" NAME="-SortField" VALUE="nSortDate"> <INPUT TYPE="hidden" NAME="-SortORder" VALUE="Ascending"> <INPUT TYPE="hidden" NAME="-SortField" VALUE="nEventName"> <INPUT TYPE="hidden" NAME="-SortORder" VALUE="Ascending"> <INPUT TYPE="hidden" NAME="-max" VALUE="1"> <INPUT TYPE="hidden" NAME="-op" VALUE=eq> <INPUT TYPE=hidden NAME=nAuthent VALUE=1> <INPUT TYPE=hidden NAME=name VALUE="-find"></P> My link to submit the form is: <A HREF="javascript:document.newsform.submit()">SearchNow</A> Any help greatly appreciated.... Philip
elvis_impersonating_penguin Posted April 5, 2001 Posted April 5, 2001 well that error probably wouldn't be caused by the javascript.. i think this is your problem <INPUT TYPE="hidden" NAME="-DB" VALUE="newsandevents"> you need a file extenstion on your database.. .fp3 or .fp5 depending on what the file extension really is. <INPUT TYPE="hidden" NAME="-DB" VALUE="newsandevents.fp3">
Vaughan Posted April 6, 2001 Posted April 6, 2001 In my experience, FMP5 Web Companion doesn't need extensions for the db name, which is a great improvment. FMP4 Web Companion requires that the file name be exactly right, which causes Mac/Win naming problems. If a solution is made on a Mac the name will probably have no extension. It them moves onto a Win box and is renamed, then all the HTML format files are broken because the -db name has changed! Just a tip... if your -MAX is 1, you don't need to sort! Ditch those tags and it'll speed things up. The only other thing is that perhaps the following tags... <INPUT TYPE=hidden NAME=nAuthent VALUE=1> <INPUT TYPE=hidden NAME=name VALUE="-find"> ...should have quotes around the "NAME" values. Ssome of the other CDML tags might need quotes too.
pcottrell Posted April 6, 2001 Author Posted April 6, 2001 quote: Originally posted by Vaughan: Just a tip... if your -MAX is 1, you don't need to sort! Ditch those tags and it'll speed things up. Thanks both of you... I think I've got it going now. The db is news events. If my max is one, do I still sort if I want to be able to step through the news events cronologically? ( the events are not entered in the db in chronological order..) Also, to complicate things slightly - can I get the javascript link to work from a page not hosted by FileMaker but by the web server? Philip
elvis_impersonating_penguin Posted April 6, 2001 Posted April 6, 2001 your javascript looks sound.. what kind of error message are you getting?? is it a javascript error or a file maker error.. you are missing a closing form </ form > tag in you post, do you have one in the actual document.. that could cause some problems.
pcottrell Posted April 6, 2001 Author Posted April 6, 2001 I do have the end of form tag, and here is the error message I get.. Search Error There was an error searching the "newsandevents" database. [# ERR: 4] Please check your submission and try again. Thanks - you are fast!!
Keith M. Davie Posted April 6, 2001 Posted April 6, 2001 And if you continue to have any problems, I would suggest that you trash this line: <INPUT TYPE="hidden" NAME="-op" VALUE=eq> The CDML Reference leaves a lot to be desired in its discussion of the Operator. Its examples are ridiculous imo. Also it is good practice to use quotes around the definitions of type, name AND value. Peace Keith [ April 06, 2001: Message edited by: Keith M. Davie ]
Recommended Posts
This topic is 8701 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