Jump to content

help with javascript form submission


This topic is 8511 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ]

Link to comment
Share on other sites

This topic is 8511 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.