Jump to content

error reporting help


darkcarnival

Recommended Posts

hi,

I'm working on a program of mine and I'm trying to make it more user-friendly.

one item my users have mentioned is when an error occurs when filling out a form they have to re-fill out the form again when they go back.

so how can i solve that?

what I'd like to do is for example how gmail does it where the error message appears next to the incorrect or missing form field or on top of the form.

but i dont know how to do that.

thats just one way i can go with this, but if anyone can give me some direction on how to about that, it'll really help me out.

thank you :)
Link to comment
Share on other sites

On your processing page, store all the info that was POSTed into an array, save the array in the SESSION and save the error in the SESSION. When you go back to the page, print the error. Get the array out of the session, and put the values in the value="" part of the html. (for textareas you just print it between the two tags, no value tag)
Link to comment
Share on other sites

jesirose is right on, in addition, it is helpful to have javascript validate the form onSubmit, and manipulate the appropriate DOM elements with error messages for any fields that do not validate, otherwise, if everything checks out > submit.

Validation in both js and php for one form is common.

Curt
Link to comment
Share on other sites

thats a given yes ;)

though a user-friendly display is what i'm trying to do as now its a real basic message and then the users get upset at me as the form data is lost and they have to re-fill the info.

I'm still bouncing ideas around, trying to mix css,js/ajax, and php to make this work with ease.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.