How to keep data in the fields when you are returned to a previous page
Posted: 25 October 2007 07:55 AM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2007-10-18

Hi all,

Is there a way to retain the data inputted to the fields when an error is discovered?

Here is the situation, I have users entering data into various fields on a form, once they submit, if there are required fields that were not filled in or if there was an error, the error page is displayed. However when I click on the “Return to Previous Page” all the previous information is gone and they have to re-enter all the data.

Is there a way to retain most of that data except for the offending field(s)?

Thanks,
Socaprice

Profile
 
 
Posted: 28 October 2007 04:41 AM   [ Ignore ]   [ # 1 ]
Member
Avatar
RankRankRank
Total Posts:  73
Joined  2006-05-10

Have you tried using Javascript error checking on the form so that it can’t even submit until everything is filled in correctly. Try :

Live Validation

This might help you out?

Best wishes,

Mark

Profile
 
 
Posted: 29 October 2007 11:32 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  6
Joined  2007-10-18

Thanks Mark. I like the idea of the “Live Validation” just have to figure out which one to download and how to use it. grin

Thanks again,
Socaprice

Profile
 
 
Posted: 29 October 2007 12:59 PM   [ Ignore ]   [ # 3 ]
Member
Avatar
RankRankRank
Total Posts:  73
Joined  2006-05-10

Hiya,

I downloaded the standalone version but I don’t think it really matters which one you download. It’s just that version is commented which I like to see when I am learning something.

Basically if memory serves me right you just link to the Javascript in the HEAD of your html page and then on a field place script validations like this :

<input type="text" id="sayHello" />

var
sayHello = new LiveValidation('sayHello', { validMessage: 'Hey there!', wait: 500});
sayHello.add(Validate.Presence, {failureMessage: "Don't just ignore me, I wanna be your friend!"});
sayHello.add(Validate.Format, {pattern: /^hello$/i, failureMessage: "How come you've not said 'hello' yet?" } );

This would basically check if you have placed the word hello in the field. Many many more options are available though but I do remember it being exceptionally easy to use though.

Hope this helps.

Best wishes,

Mark

Profile
 
 
Posted: 31 October 2007 08:55 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  6
Joined  2007-10-18

Got it working. Thanks. I would recommend this to everyone.

Socaprice

Profile
 
 
Posted: 31 October 2007 09:11 AM   [ Ignore ]   [ # 5 ]
Member
Avatar
RankRankRank
Total Posts:  73
Joined  2006-05-10

Me too!!

I am currently using it on a SAEF that needs a LOT of validation and this is the best script that I have seen so far. Exceptionally easy to use and very very powerful.
Definitely one that will stay in my arsenal of web-weapons for quite a time to come!! grin

Best wishes,

Mark

Profile