/    Sign up×
Community /Pin to ProfileBookmark

Form not keeping state

I have a form that allows the users to move items around on the page. When the items have been rearranged the user clicks the “Save” button and all of the coordinates of the items are stored to the database.

Here is my problem…

After the data has been saved the items are restored back to their original positions.

Here is how it works…
When the user clicks the “Save” button javascript is invoked that will gather all of the coordinates of the item and store them in two hidden, server side, input controls (X and Y). *** This works fine ***

On the server side the data is retreived from the two controls and then stored in the database. *** This works fine ***

But when the process is finished the items are all back in their original positions. I have code in place that keeps the page from rebuilding itself and putting the items back into their original positions.

So, what is causing this to happen?

Thanks.

to post a comment
Full-stack Developer

0Be the first to comment 😎

×

Success!

Help @texas1992 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...