Jump to content

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

Recommended Posts

Posted

Hi there,

I have just created a simple search, list and form.

The search form has a few input fields and a preset hidden field.

the format file is List.html

the error file is Search.html which is the search form as well.

Everything works fine. I can do a find and goto the list and form.

The problem occurs when the database failed to return any records

and it redirects to the search form again (I display a red color text showing there was no records found) . Then I tried to enter some other texts for the search. It gave me the following error:

[color:"red"]

Command is invalid:

Unable to to process your because the server encountered and invalid command. Please correct your request and try again.

Please shed some lights on my issue.

Thanks a lot,

Hameed

Hong Kong

Posted

I wonder if this line:

<input type="hidden" name="-max"       value="[FMP-Field:g_Max_Show_Record_List]">

Causes a problem when submitted after an error because it may not have been replaced!

Does the Valuelist have entries when the page has been returned after an error?

All the best.

Garry

Posted

Yes it can show the value list perfectly after it returned a no records error.

Yes your clue is right. After the db returned no records this tags

<input type="hidden" name="-max" value="[FMP-Field:g_Max_Show_Record_List]">

becomes

<input type="hidden" name="-max" value=""> (obviously there is an invalid command)

[FMP-Field:g_Max_Show_Record_List] is a global field. I assumed that the global field shows up even the db returned no records.

If I change my above tag to <input type="hidden" name="-max" value="5">

something like this everything works fine.

Any idea why the global field is not showing up??

Many thanks

Hameed

Posted

Hameed writes,

>Yes it can show the value list perfectly after it returned a no records error.

>Yes your clue is right. After the db returned no records this tags

...

>Any idea why the global field is not showing up??

I've recently experimented with the fmp-includefield tag, which prefers a global. Seeing your question I went to this test folder and ran a -find which returned error 401 on the error.htm. Also on the error.htm was the tag to display the global field. Needless to say, that global was not displayed. When I looked at the db file, I could clearly see the global field. However, because the status bar revealed "Found: 0", it was obvious that there was no record from which the cdml tag could access the data.

Posted

Thanks Keith & Garry for your advice.

I would hard code the max no of records within the HTML to solve this issue. That's fine for me now.

Thank you all again for your assistance.

Hameed

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