Based on http://semantic-ui.com/behaviors/api.html#/usage, I think my code actually run.
Here is the code :
$('#new-modul').form({
fields: {
division: {
identifier: 'division',
rules: [
{
type : 'empty',
prompt : 'Please select division'
}
]
},
application: {
identifier: 'application',
rules: [
{
type : 'empty',
prompt : 'Please select application'
}
]
},
title: {
identifier: 'title',
rules: [
{
type : 'empty',
prompt : 'Please enter a title'
}
]
},
description: {
identifier: 'description',
rules: [
{
type : 'empty',
prompt : 'Please enter description'
}
]
}
}
})
.api({
url: './ajax/Ticket/new.php',
method: 'POST',
serializeForm: true,
onComplete: function() {
completeCreateNewModuleAction();
}
});
But maybe something went wrong, so the error appears on my console.
Error :
API: jquery-serialize-object is required to add form data to an existing data object
And I don't know why. Anybody knows about this?
You need to include https://github.com/macek/jquery-serialize-object as stated in docs