Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi

I have been working with LAJAX and have successfully got it working at a basic level but have reached a point where I could do with some help. I have a PHP new record page with a form that passes the values to a second page that creates the FMP record and then redirects to a details page. What I am struggling with is preventing this process showing in the browser, when I click the submit button on the initial form the browser loads the new page but not within the AJAX div tags. I can see that you are doing what I am trying to achive in the Filemaker feature requests section of FMPug. Any chance you could share the technique. I am really wanting to know how to change the submit form and the redirect pages so that the end result is that you click the submit button, the PHP pages do there stuff and then the details page loads into the AJAX area.

Thanks in advance

Posted

Danny,

There are two options here.

Firstly you target a very specific DIV tag on your page that updates the whole form. This is fairly simple.

Simply reference your DIV tag with a unique id and then inside your LAJAX call you target this hard coded DIV to be the part of the page that updates.

The more complicated option is to target dynamic DIVS as we do on the FileMaker Feature Requests.

This involves passing new variables to the javascript for the specific DIV in question and then using this new variable to be the one that is updated. The benefit of this is you can now update a portion of the data as opposed to the full recordset returned.

If you are just processing a form I would defintely go with the first approach.

If you wish you can contact me back channel or post your code here that you are using and we can fix for you.

I highly recommend Firefox when testing AJAX based pages with an extension called Firebug. You can find the Firebug extension at https://addons.mozilla.org/extensions.php

This allows you to see the information being passed to and retrieved from the XMLHttp Requests in a small pop-up window that can help alleviate any problems.

Posted

Hi Andy

Thanks very much for the swift reply. You have certainly pointed me in the right direction and I nearly have it working, the form is passing one of the fields in the form to the next page and is creating the record in FMP and displaying the details page in the Ajax DIV tag. The only thing I am not getting is the correct syntax for passing all 3 fields that are in the form which are Day, Month, Year. The link that posts the form is

Load Post Data

I am sure the Month and Year fields also need to be sent in an array but I can't get the syntax.

The FMStudio/PHP that populates the record is below. As I said the Day value gets there it's just the other 2 fields that I can't get.

$add_result_fields = array('Day'=>$_POST['Day'],'Month'=>$_POST['Month'],'Year'=>$_POST['Year'],'timenumber'=>$_SESSION['rand'],);

Thanks again for all you help.

Posted

Danny,

You are pretty close.

Yes you are correct that the other two values must be passed through the javascript.

You need to append the other values to your query using the & between each name and value pair.

Try

Load Post Data

HTH

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