I need help learning how to save and restore form data

I would suggest you add a key field, perhaps something like UserID which should be an auto integer number field
So create an integer field, name it, click the A_I check box then in the structure view click on Primary

1 Like

I was going to do that but I have another table that has username and userID - I thought I would (somehow) - use the username in this table to form an association with the username and userID in the other table.

I was thinking once a user logs in I could use that info - likely I need to watch your relational DB video #1 again and watch your 2nd one once you post it… I really have no idea what I’m doing…

Basic rule, every table should have a key field of some type which must be unique. Easiest and most efficient way to do that is as i describe above

2 Likes

If you add a primary key to your database, it enables you to edit records in phpmyadmin so I recommend it. It’s a general guideline to have one unique column in a database.

1 Like

OK, I’ll add it in using phpMyAdmin (I forgot about rule #1) - do I somehow need to add that key field into my wappler form also?

if you open your database connection in server connect and then re-save, wappler will read the new structure

1 Like

OK, that worked :slight_smile:

OK, so I followed along with the direction @George gave me - my database is set up and I did the front end form like in the directions. It seemed to work fine.

So now I need to put the save button on my already existing form (and I’ll call it a win for today)…

Looking at the form that was generated by wappler it looks like I need to add the button and maybe one line of code to save the data on my form.

the two lines I think I need to add to my form are below - is it that easy or do I need to do / should I do something else?

<form is="dmx-serverconnect-form" id="serverconnectform1" method="post" action="dmxConnect/api/Data/insert.php" dmx-generator="bootstrap4" dmx-form-type="horizontal">
<button type="submit" class="btn btn-primary">Save</button>

I reckon you just forgot to change the button type to “submit”. This can be easily done in the properties. You also can assign the button in the form generator and change the button type to submit there.

1 Like

Thanks for continuing to help me, I’ll look at it tomorrow - been messing with a login page for hours - 100% burnt out for today… Can’t seem to get anything to work :frowning:

Yes, as @jowhiskey says.
Firstly make sure you have set the form to a server connect form, if not click the “Make Server Connect Form” button
image

Secondly make sure the button is set to submit
image

1 Like

Site security is very well documented. Check out:

https://community.wappler.io/c/docs/security-and-login

Read the topics from oldest to latest. After that you have a clear overview how everything works.

2 Likes

After many many hours working on trying to get the database set up to save records - I stopped working on that part. I decided to try implementing another part of what I need to get working. The user logon stuff.

I followed the documentation (very very carefully). I did everything step by step (and there are places in the documentation that don’t match what is displayed in Wappler) - I checked everything over and over many times - when I got done everything shows up but when I enter a correct username and password (or an incorrect one) nothing happens.

The page redirect on success does not work and the alert that is supposed to surface if incorrect information is entered does not display. I even did this with a static user file so it was not complicated by any SQL database.

Starting to seem hopeless. Everything I try to do seem overly complicated and most of what I try never works no matter how much help I get or how many different ways I try to do it…

The reason for this could be the newer versions of wappler where the UI changed. It’s impossible to keep up the documentation to the actual version every time wappler gets an update.
As for the failure, I’m sorry but my knowledge ends there. There are many possibilities what went wrong.

Yes, I understand and agree - with the pace of SW updates it would take an army of people to keep all the documentation perfect.

I think I just need to take a little break - I need to do some work in the garden today anyway. Thanks again for taking the time to help me - I know everyone is busy and helping me does not really do anything for anyone else - the great folks here are just kind and generous souls :slight_smile:

1 Like

I disagree. By helping others, one can increase his personal skillset and to be a bit poetic, really make the world a better place. At least the software dev world :):blush:

3 Likes

I am sure as you ask the questions, many follow and learn with you. It’s like teaching by example.

4 Likes

I’ve been equally stuck on this part for some days now, reading all documentation and posts carefully. I do get my database connections validated and forms get very nicely built with the bootstrap 4 form generator based on the tables and fields in my database.

When I try to save records, hitting the button seems to not trigger any action. It was configured as a submit button and the form got connected to a server action. What I did across all posted screenshots, however, is the “server/database icon” going with a “server connect form”. Looking at my forms, they continue showing the “form icon”.

@norcoscia Did you manage to solve this issue or could anyone else guide me in the right direction? Feels like only being 1 step away from this to work…

Can you post a link to your page, where we can check this?
I am not sure I understand your question about:

is the “server/database icon” going with a “server connect form”.

Also make sure to check this: Debugging Problems

6 posts were split to a new topic: Login form troubles