Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New list item : On error, all entered data is lost

Status
Not open for further replies.

kalliet

Programmer
Jul 13, 2009
2
BE
Hello,

The situation of my users:

They want to add a new item to a list. (New item)
They enter a lot of data.
They click OK.
One of their values does not comply, so they get the error page (Error. Go Back to page. And an error message, I described with my eventhandler (properties.Cancel=true; properties.ErrorMessage= "..."))

My problem is that my users are complaining because when they press the 'back' button of their internet explorer, all the entered data is gone. So they can start over ...

Is there a way to preserve the information they entered in the newform.aspx when I use the properties.Cancel so that they press back and they still see what they entered and can just continue with their data to change the wrong fields?

I don't seem to find information on this anywhere...

thx in advance,
 
hi kalliet,

exactly what kind of validation is being done in the event handler?
cant it be done in post addition? in that case you could maybe set a flag so that the item is not yet valid?

Known is handfull, Unknown is worldfull
 
Have you considered using JavaScript or something similar?

I would suggest a custom form web part that you then edit in SP Designer and add some JavaScript to validate the input. This would prevent the user from even submitting the form in the first place.

In SharePoint Designer it is under Insert->SharePoint Controls->List Form. You then have to choose your options. Then go in and edit the new form web part to fit your needs. Once you have finished that, go into the "edit page" in the list and set the orginal web part to hidden. I also suggest that you make a copy of the page before you begin to edit. I just go into code view and copy/past the code into notepad. You should not delete the original web part in the NewForm.aspx page. I have only ever seen it break the "new item" link.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top