Forums

Server side validation

chriso0258 10 Aug, 2015
Hello,

I am trying out the server side validation action. I put the field name in for a text box in the alpha-numeric box (prod_key:Please add a valid key) and an event loop in the on Fail section of the action. I then tried testing the box by typing in something like $edit => '2' in the text box and all of it was saved in the db. Are special characters still considered alpha numeric characters? If not, why would I not get the error message?

Thanks for the insight.
GreyHead 10 Aug, 2015
Hi chris0258,

I built a very simple form to test this here and that appears to be working OK.

Do you have the Server Validation action before the DB Save action? That might explain why the data is being saved - the validation needs to come first as CF runs the actions in sequence.

Bob
chriso0258 10 Aug, 2015
Hello Bob,

Thanks for your answer. Yes, my validation is before the data is saved. Below are pictures of my configuration. Please note that I have tried it with both the model id (editList[prod_key]) and without the model id (prod_key) and I get no error message.

[attachment=0]validation1.jpg[/attachment]
[attachment=1]validation2.jpg[/attachment]
GreyHead 11 Aug, 2015
Answer
Hi chriso0258,

Ah . . . I've not seen that before, after a little testing it looks as though array names have to be entered into the Server Validation like this
editList.brand:Please add a valid key
Then it seems to work correctly.

Bob
This topic is locked and no more replies can be posted.