Jump to content

Using XML data within a Javascript?


hellohelp
 Share

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

Recommended Posts

Hello,

I really don't know if this is even possible, but I thought I'd ask. I have an XSLT page in which a user enters an ID number and selects a checkbox for an available time slot. When the user hits the submit button, the page runs a javascript to make sure the user has entered an ID number and selected a time.

However, I want to be able to verify that 1. the time slot selected is available (meaning I want to see if the FMP field is empty), and 2. I want to verify that the user ID matches the value of another FMP field. I have no idea how I can get a FMP field value within a Javascript. Is this possible?

Thanks for your help!

Tom

Link to comment
Share on other sites

When you submit a record via XML/XSLT, FileMaker does roughly the same as when you submit the record in FileMaker itself. This means that if you set some validation options and the incoming record doesn't match them, it will be rejected and FileMaker return an error. It must be somewhere in the grammar you use in the tag. In the target XSLT page you can check this value and either display an "Ok" message or "Please go back and select another slot" message. This is a simplest handler, a more sophisticated one could redirect the user back to the initial page and display the error message there and so on.

If you want to check things without leaving the page, then you need to use the AJAX technology, but this would probably be more complex.

Link to comment
Share on other sites

This topic is 5589 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
 Share

×
×
  • Create New...

Important Information

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