Browser goto function with submit form with two inputs value to filter another page

Hello,

I hope someone can assist me here.
I have a submit form with two inputs to filter the query on another page.
The first input : filter
second input: location

I created two gets value to filter the form.
I also created two value in the define query parameter.
According to @ben, “Thank you for your last help”
dmx-on:success=“browser1.goto(‘your-file?param1=’+value1+’&param2=’+value2+’&param3=’+value3)”`

Can be used for multiple params. However, I am not sure how to use this syntax when we have to filter the page using a submit form and url.

I was wondering if I can use something like this:
dmx-on:success=“browser1.goto(‘searchBusiness.php?filter=’+value1+’&location=’+value2)”`
And what will be my value1 and value2 if the query is filter is coming from the input form.

Capture2 Capture

This is correct

For the page that shows the results, first you will need to specify the parameters as per


The documentation shows the one parameter, you will need to repeat the process for the second parameter.

To filter the data have a look at

I hope this helps.

As an aside, why not enter the details and show the result in the same page?


You can have multiple inputs to filter the database.

2 Likes

The details are displayed in the same page with the filter and location.
However, it is make sure users can use the url if they try to go back to the same info. Or they want to keep the info in the browser.
I tested the form and the filter in the form. It is working and it s showing the result of the filter on the page, but it is not coming from the url parameter.

How about storing the data. There is a choice of temprary storage such as Session Storage or a persistant Local Storage.

I have been trying all night. I cannot understand or see what to put in value1 and value2 when the filter is coming from two inputs.

I made the query with “filter” for condition.

Now, I have the “Get” variable like it was explain in the tutorial.

I used the selected the input for the server connect to match the data in query manager.

Capture3

For the form submit: I selected success load the serverconnect3.
I used the input in the form to match the filter and location.

The text input filter match on the same page to filter the query.

Now, when I tried to use the url value to go the same page to filter the same query. I get lost.

dmx-on:success=“browser1.goto(‘searchBusiness.php?filter=’+value1+’&location=’+value2)”

I need to get to the url using the value in the input form.

I don’t know what I am missing.

Have a look at Paul’s (@psweb) answer
Jul '18

I did this the other day.

on my page I have 2 text input fields (without a form)

<input type="text" class="form-control" id="filter_post_code" name="filter_post_code" placeholder="Filter: Post Code">
<input type="text" class="form-control" id="filter_email" name="filter_email" placeholder="Filter: Email">

Then I have a single Server Action with
Globals
$_GET (Right click > Add Variable) and name the variable exactly the same as the input id which is the same as the input name too
So mine looks like this
filter_post_code (Type > Text & Linked Field > BLANK)
filter_email (Type > Text & Linked Field > BLANK)

Then in Execute > Steps I have a Database Connection step and a Database Query that looks like this

SELECT * FROM AcConsumerDB WHERE acCdbAddressPostCode LIKE :&_GET_filter_post_code AND acCdbEmail LIKE :$_GET_filter_email

So basically in the columns area, I added my entire table, then in the conditions area I added the acCdbAddressPostCode field and set it to contains {{$_GET.filter_post_code}} AND acCdbEmail field set to contains {{$_GET.filter_email}}

Hope that helps, it is working perfectly
In my page I have 50k records and i add part of a UK post code like just RH and the records returned are about 900 and then I add part of the email address like sam and the records retuned come down to 4

Thank you. I will try it today and let you know. Thank you again.

Thank you ben. It is working exactly the way I was looking for.