How To Keep Data From Inputs

I have a form that is populated by an input search query.

However, I would like the form not to show the first row of data from the database. As you can see, although there’s no number in the input, the first record in the database is shown (see image below).

The data shouldn’t show until an account number is entered in the input field (see image below).

Don’t auto load the data source. Load it once the search input has been populated.

image

2 Likes

I knew I was blind in one eye; but two? Thanks Ben you are a great help!

It is still ignoring that No Auto Load…

<dmx-serverconnect id="sc_search_rd" url="../dmxConnect/api/Locate/locate_ms_rd.php" dmx-param:regionid="sc_search_ms.data.query_ms[0].regionID" dmx-param:search="search.value" noload="noload"></dmx-serverconnect>

Any other ideas that I might have overlooked?

Why don’t you simply filter your dropdowns using the number entered?
Aren’t they related?

Are you sure you do not have another script on the page that auto loads and has an on complete, on done, on success even that fires that server action?
Turning off auto load should work unless something else is firing it.

The filter is governed by the input field where the person’s last name or account number is entered. The query automatically returns the data that will populate the email message.

The two drop-downs provide extra information that is not in the database. The info they contain personalizes the email with the orientation type and the proper salutation information.

I’ve check everywhere, and still no luck.

I assume from your screenshot that the Aaron Anderson Brazil information is the first record in your database? And if you changed the sort order of your Server Action to DESC just to test then on page load it would start with the last record in your database table.

Yes, you’re right, I did try that. In the above screenshot, it was the last record, once I changed the sort order of the query it reacted accordingly.

Ok well at least by that we know its not pulling it from some other strange place, so thats cuts out one possibility.

The params of
dmx-param:regionid="sc_search_ms.data.query_ms[0].regionID" dmx-param:search="search.value"
on your serverconnect noload command, if you temporarily cut those out and save and test does the script still load automatically? Obviously paste them back or undo once you know the result, I dont want to be the guy that broke your site completely, haha

Haha! Yeah, I’ve tried a couple of things similar to that. I will give it a whirl.

I’ve already made copies of the original pages. The copies are the ones that I’ve been playing around with.

I’m not certain, but all of this may have started when I tried to using a View of two combined tables. This was due to a client that decided to change all their personnel’s email addresses. This caused a break in the login page. The exec’s have a different suffix (domain) on their email addresses, and use the same login security provider. So I used a View to bring them together for that sole purpose.

So I’m now following the query trails of all the affected code. Most have been easy to ‘reconnect’ the broken link. This one, however, has really stumped me.

1 Like

Hahaha, story of my life.

Currently i am trying to fix a Wappler build website that worked flawlessly for 7 months, the hosting company said they had a server issue and did a backup and restore of my site to a new server on their side, and now the site no longer works at all, so im in a similar boat to you right now.

1 Like

Can you not maybe add a condition before the query that says if the input value is empty then do nothing, and if not then run your query.
Or a condition inside the query to say AND input NOT NULL or something just to get around the issue?

Yeah, that might work. What held me up was that it worked perfectly prior to the change. Maybe I’ve been trying to find something that no longer exists! Ha… Thanks!

1 Like

When I do figure it out, I’ll let you know. No matter how embarrassing. Ha!

1 Like

The problem was the CONDITION was set to CONTAINS! Once I changed it to EQUALS, boom!

Embarrassed, but very HAPPY! Now we can move on… to greater things!

1 Like