Hi Leevi,
Try looking at Live Validation. Using this will stop you from ever seeing the purple screen of death!! 😊
Hope that helps.
Best wishes,
Mark
P.S. Alternatively you could change the CSS so that you get a nice pink screen of death!! 😊 😊
Hey guys,
I will be using some javascript validation on my form but like Brian said it shouldn’t be the only line of defense. I think if I use Javascript first which will be a fair chunk of users and then back it up with a pink/purple screen of death for others.
So on a more technical level which method call brings up the purple screen of death?
Cheers
So on a more technical level which method call brings up the purple screen of death?
Hi Leevi,
Well at this point I will gracefully bow out I’m afraid. I’m not too sure what calls that screen but I’m sure that one of the clever bods in here will do though. Sorry I couldn’t help further but my coding knowledge is a bit limited at this stage I’m afraid.
That said Live Validation really is one of the simplest Javascript validation routines out there as even I can use it!!
Hope it all goes well for you.
Best wishes,
Mark
I think Leevi means the standard EE template that appears when you haven’t filled out a form correctly or completely. Purple as it is the standard EE install CSS. With Live Validation this would not be a problem as the user wouldn’t be able to submit the form until everything is filled out correctly but I think (if my understanding is correct) that Leevi is also worried in case people have Javascript turned off then Live Validation isn’t going to be of much use.
Best wishes,
Mark
Leevi
Thought that might be what you meant but wanted to be sure before I opened my mouth.
You obviously know how to call it. And calling it due to a form validation error that is due to user input is obviously a valid usage for the Output error functions.
You can certainly combine a live validation technique with validation on the PHP end. And that is probably the best way to handle it if you want to do both you simply need to make sure that the live validation doesn’t prevent the form from being submitted normally when javascript is inactive. Most javascript libraries provide for that kind of functionality by default now (jQuery certainly does).
It would not be advisable to not provide PHP validation on a form. You don’t want there to be a way for badly formed data to make it through if javascript isn’t active or if something stops it from running as expected.
Jamie
I cannot echo Jamie’s advice strongly enough. Javascript validation is to benefit your user, making a pleasant and friendly experience using your form. Server side validation is necessary for security and validity of data. Some of the more common security holes in web applications these days are caused by programmers expecting that there is only one way for data to be sent to their application: from a page and form that they designed and intended for that purpose. And that could not be more far from the truth.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.