Jump to content

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

Recommended Posts

Posted

Quick question:

I know how to make a URL that will create a new record in my database.

I know how to use a form the create a new record in my database if the user is already logged into the database.

Can a form create a new record if the user IS NOT logged into the database? For example, the user goes to a standard web page NOT being part of a FM solution. On that page is a form. I would like the user to be able to fill out the form, hit submit, and have the information submitted as a new record to a database. I know how to use something like:

<form action="FMPro" method="post">

<input type="hidden" name="-DB" value="names.fp5">

<input type="hidden" name="-Format" value="results.htm">

<input type="text" size=12 name="Country" value="Australia">

<input type="submit" name="-New" value="New Record">

</form>

But this assumes the user is ALREADY in the database. If the user is NOT in the database, where would I enter the information such as URL information for the database? Maybe something like:

<form action="http://xxx.xxx.xxxx/FMPro" method="post">

Larry

Posted

Hello, Larry! I used to use the <FORM ACTION="http://.../FMPro" METHOD="post"> as my preferred way rather than just "FMPro" and it works great, even from web forms served from other servers. The -format page must be in the web server directory, though. Mostly I've done this for search engines, though, so no login's were required. I remember folks somewhere mentioning using the URL for logins but I'd never trust that, plus I heard Windows IE6 disabled its ability to do it, anyway. You can always just allow users with no passwords to make records, too, depending upon your situation and use.

--ST

Posted

That is what I thought. Here is what I tried:

<FORM ACTION="http://xx.xxx.xxxx/FMPro" METHOD="POST" name="New">

<input class="text" type="text" name="Name">

<INPUT TYPE="hidden" NAME="-db" VALUE="Survey Contacts.fp5">

<INPUT TYPE="hidden" NAME="-lay" VALUE="Web">

<INPUT TYPE="hidden" NAME="-format" VALUE="thanks.html">

<INPUT TYPE="hidden" NAME="-error" VALUE="error.html">

<input type="submit" name="-New" value="Submit">

I would expect this to create a new record in my database, filling in the field called Name. Instead, upon Submit, it goes directly to the error page.

Been a while since I have done any CDML, so I am a bit rusty at this.

Larry

Posted

I'm rusty, too... Could it be generating the error because of not finding the -format page? If you are using a subdirectory, you'll have to specify that, too.

Try

...ACTION="http://xx.xxx.xxxx/mysubdirectory/FMPro"

if your -format is http://xx.xxx.xxxx/mysubdirectory/thanks.html

Hmm.. actually, try http://xx.xxx.xxxx/mysubdirectory/thanks.html in your browser and see if you see your format page. Otherwise, the form and code looks good to me except for the css class reference to which I am somewhat still ignorant. Oh, maybe delete the -error line for now so that you can get some feedback on the type of error, even if sometimes it's not true. And check that your field names match your objects and that those fields are on the "Web" layout... All stuff you know, I'm sure, but like you said, we're a little rusty at CDML.

--ST

This topic is 7220 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.