Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Search by JavaScript variable

Featured Replies

Skuli,

Try it this way:

code:


<script>Document.Write("FMPro?-DB=Schedule.fp5&-Lay=table&-Format=CalendarMonth.html&Date=" + dateString + "&-Find");</script> target="Display"

Hope this helps.

Garry

[ April 11, 2002, 01:53 PM: Message edited by: Garry Claridge ]

Thanks Gary,

I was afraid this was the way to do it. Unfortunately this means the I have to document.write the entire index.html page and all the links.

I was hoping that there was a way to simply insert the JavaScript variable into the href string.

I think I might try to make a text box and have the JavaScript put the answer into that box and then have the FM URL link preform a search based on the content of the box. I suppose I could also put this box in a hidden frame so the user doesn't see it. Hummm....

Thanks for your help

  • Author

Skuli,

I usually use forms, not urls. Hence, I can use functions like this:

code:


function doSubmit()

{

with (document.FormName)

{

//concatenate the dates together

var sDate;

sDate = (elements[12].value + "/" +elements[11].value +"/" + elements[13].value)

elements[2].value = sDate;

submit();

}

}

I can call the function from any href. Also, I can have any number of forms and only submit the relevent one.

All the best.

Garry

  • Author

Have a look in the "adding multiple rows in a portal from web" topic. I have included a number of different form submits and href's.

Hope they help.

Garry

Hey All,

I am trying to figure out a way to insert a JavaScript variable into a search string using a link. The problem is that I can't figure out the syntax for getting the variable into the string.

Basically the following JavaScript (which works) returns the date in the form of the current month, day one and the current year as the variable DateString.

<!--

function TheDate[] {

var Datum = new Date[];

month = Datum.getMonth[];

year = Datum.getYear[];

dateString = month + "/1/" + year;

}

-->

I had to replace the parenthesis with []for the post to work.

Now what I can't figure out and maybe it isn't possible is to get dateString into the search link.

"FMPro?-DB=Schedule.fp5&-Lay=table&-Format=CalendarMonth.html&Date=dateString&-Find" target="Display"

Any ideas? Thanks.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.