Jump to content
Server Maintenance This Week. ×

[FMP-tags] within javascript


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

Recommended Posts

  • Newbies

Hello! I need your help!

I'm using javascript on a page to change a jumpbox dynamically. This page also connects a FMP database and I'm having difficulties using [FMP-tags] within my javascript! It just won't work.

Here are some details about my script. The script checks to see what selection the user makes on a "select-tag" (i mean <select> ) and then dynamically loads a second "select-tag" accordingly to his choice. I use writeln(...) to display the text and also the <script>...</script> does not produce all the html page but only a certain part, the part that needs to be dynamic.

Since I'm using a script to load and modify the user's selection into the db, I have to work with <script>...</script>. My problem is the following: when a user enters the site to modify his "profile", the script has no memory so it cannot put the proper user selection in the select-tag. I have to go take it in the database. My solution was to display the field as the first option. But since I'm inside a <script> I cannot access the database with [FMP-tags]...

I'm sure there is a way to do this, but how? Is this cause the javascript is executed/parsed before the [FMP-tags] ?

Thanx inadvance and PLEASE help me! smile.gif

Link to comment
Share on other sites

  • 3 weeks later...

quote:

Originally posted by MrHappy:

Hello! I need your help! ..........

..... I'm sure there is a way to do this, but how? Is this cause the javascript is executed/parsed before the [FMP-tags] ?


[FMP-tags] are processed on Server and they are not in page code at all, they are replaced by data from FM.

JS is send with page to the browser and then executed there in browsers.

Try do the IF from HTML and FM:

[FMP-If: LeftSide Operator RightSide ]

...HTML if condition is true...

[FMP-Else]

...HTML if condition is false...

[/FMP-If]

Hth

Link to comment
Share on other sites

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