Page 2 of 2

jQuery validator plugin

Posted: Sat Jul 11, 2015 12:10 am
by Jack Bua

Also, I too am a little confused on how I can use this plugin without having to create all the desired controls within an html component. I want to use this plugin on controls made by the visual editor. Is this possible? If not, what are some alternatives to achieve validation?

I believe validation is very important, and also it should not be a clunky piece of code on every button on every page. A tutorial would be very helpful.


jQuery validator plugin

Posted: Sat Jul 11, 2015 1:42 am
by Jack Bua

I know this is a big question, so I would like to make it quicker to answer for you.
I have the following code to use to validate some components on a dialog called "lineitem_add_dlg". The create service is invoked by the button "create_button" and there are two inputs on it, name_input and details_input.

$('#form1').validate({
rules: {
name_input: {
required: true
},
details_input: {
required: true
},
},
messages: {
name_input: {
required: "Please enter the line item name"
},
details_input: {
required: "Please enter the line item details"
},
},
errorPlacement: function (error, element) {
error.appendTo(element.parent().prev());
},
submitHandler: function (form) {
$(':mobile-pagecontainer').pagecontainer('change', '#success', {
reload: false
});
return false;
}
});

How could I modify this code for it to work with appery?


jQuery validator plugin

Posted: Tue Jul 14, 2015 6:19 pm
by Jack Bua

Could I get some help on this please? I seem to be having an issue when it comes to catering code I find to work with what Appery makes.


jQuery validator plugin

Posted: Sat Jul 18, 2015 4:10 pm
by Illya Stepanov

You can ignore them, these are just warnings.


jQuery validator plugin

Posted: Sat Jul 18, 2015 4:20 pm
by Illya Stepanov

To be able to use a visual editor components with external JS library, the input data should be modified, because it wasn't made for Appery.io builder originaly.
If it needs some particular HTML structure to validate fields, it is better to use HTML component with needed HTML structure inside it.


jQuery validator plugin

Posted: Sat Jul 18, 2015 4:29 pm
by Illya Stepanov

Hi Jack -

Perhaps someone from community has integrated this library with Appery.io project and can share his solution.

But unfortunately, this custom implementation falls outside the scope of our standard support.


jQuery validator plugin

Posted: Sat Jul 18, 2015 7:20 pm
by Jack Bua

Illya,

Thank you for your replies, both of them. I will see what I can figure out on my own as I get more familiar with JS, jQuery and Appery and I will post any results back here.