Jump to content

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

Recommended Posts

  • Newbies
Posted

Hi,

Relatively new to Lasso + FileMaker so please excuse my ignorance if this is simple one to figure out.

I have just finished linking a Filemaker 5.5 record database with Lasso and I am wondering if it is possible to perform a search based on a text field via a pop-up field. I don't require multiple search fields and I don't have much space on my web page so rather than list 3 fields within the page is it possible to say have one text field where the user would type in the search text and next to it to have a pop-up menu containing the field which would be used to search for the text.

A good example of this can be found on the front page at http://www.gemm.com - This is exactually what I am looking for.

Sorry If I haven't explained this very well.

Any help would be much appreciated!

Many Thanks,

Matt

Posted

On your form page, this is what your popup menu will look like:

<select name="xx" size="1">

<option value="Field1">Field1</option>

<option value="Field2">Field2</option>

<option value="Field3">Field3</option>

</select>

On your response page,

[inline: -Search, database='databasename', layout='searchlayout', (Form_Param:'xx') =(Form_Param:'textboxname')]

[/inline]

Note that you are passing the names of the user inputs to the next page as Form_Params. It is actually better practice to set these as variables at the top of the page, then call the variables in the inline. Use the [Records] tag to display results within the inline.

Feel free to ask more if you need to. I assumed you understand Inline methodology.

Tom

[email protected]

http://www.tgparker.com/filemaker

  • Newbies
Posted

Originally posted by Tom Parker:

[QB]

On your response page,

[inline: -Search, database='databasename', layout='searchlayout', (Form_Param:'xx') =(Form_Param:'textboxname')]

[/inline]

Sorry for being completely dumb but I take it I subsititute 'databasename', 'searchlayout' & 'textboxname' with real values?

Also does the textbox on the search page actually have to be a field within the FileMaker Database? I have tried both ways and all I keep getting is "No Records Found" Error - "1728" once I submit the search

Thanks for your help.

Matt

Posted

In the first page u need to setup your form slightly differently, I would also recommend change the name of the response page to .lasso suffix if you havent already (makes sure lasso processes the page even when not returned from a post )

eg

First page

code:


<form name="whatever" action="thenameof theresponsepage.lasso" method="post">

<select name="xx" size="1">

<option value="Field1">Field1</option>

<option value="Field2">Field2</option>

<option value="Field3">Field3</option>

</select>

<input type="text" name="string_to_search_for">

<input type="submit" name="-Nothing" value="findit">

</form>

The -Nothing action stops lasso trying to perform any db actions ie trying to find a field called XX (or whatever you want to call it) In your database. All that happens is that the values from the form objects on the first page are passed to the response page for processing (page named in the form action).

PS nearly forgot:

The values are sent to the response page as named (the same name as the form object) Form_Param 's which are replacement tags. (ie when processed by lasso they are replaced by the value assigned to it)

The form params should be used to set variables in the response page....it will allow you to reuse the values as many times as you like in the response page...... Vars are used because form params can only be used in your first action on the response page.

Note:

When used inside other tags use (......)

instead of [........] for lasso tags - for an example see the Ifs and inline below. To just return the value of a Var on a page it would normally be expressed [Var: 'varname'] in a lasso tag this is changed to (Var: 'varname')

Response page named in form action:

head body etc.....

[Var_Set:

'mysearchfield' = (Form_Param: 'xx'),

'mysearchvalue' = (Form_Param: 'string_to_search_for')

]

[if: (Var: 'mysearchfield')=='']

[include: 'firstpage.htm']

[Else]

(Notice u dont use ' .....' around replacement tags only literal values)

[inline:

database='your_db_name',

layout='your_layout',

(Var: 'mysearchfield')=(Var: 'mysearchvalue'),

Search

]

[if: (Error_CurrentError, ErrorCode)=='0']

[Records]

HTML to view records

(either straight on page or included file - see manual for more on this wink.gif )

[/Records]

[Else]

HTML to show error

(or)

[include: 'Error.lasso']

[/if]

[/inline]

[/if]

hope this helps - scuse any typos!!!!!

laugh.giflaugh.gifcool.gif

[ February 09, 2002, 04:24 AM: Message edited by: scratchmalogicalwax ]

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