Welcome Guest, Not a member yet? Register   Sign In
Validation Helper question
#1

[eluser]Kamusksn[/eluser]
Hello, I have a question about the validation helper.

Is usefull for validating forms created dynamically with ajax and jquery?, or should I need find another method for validate on the client side.

Actually when I run the validation rules I lost my content loaded with ajax and the field created with jquery.
#2

[eluser]CroNiX[/eluser]
You 100% of the time need server side validation. Clientside validation can be manipulated or ignored by turning javascript off in the browser and then it won't work at all. Clientside validation is nice, but never ever ever use it by itself. You will get owned.

It's hard to answer your question about validation rules without seeing an example of the dynamic fields you are generating. You need a validation rule for each form field "name". You can have multiple fields with the same name if you use the array syntax, like:

Code:
<input type="checkbox" name="mycheckbox[]" />
<input type="checkbox" name="mycheckbox[]" />

And then have a rule defined for "mycheckbox". See the user guide for more info: http://ellislab.com/codeigniter/user-gui...ysasfields

#3

[eluser]Kamusksn[/eluser]
thank you for reply, I have a form group were I fill the following fields [quantity] [description] [price], when the user click "add" button a script it's called and the content of the field create a dynamic table with "N" quantity of rows.

Example
http://jsfiddle.net/fiddleyetu/jBx9q/3/

As you can see I use append to create the inputs, once I submit the form and it's validated I will lose the content.

I want keep the dynamic content created, on this case the dynamic table with the input fields.




Theme © iAndrew 2016 - Forum software by © MyBB