sherly febrianti sherly febrianti - 4 months ago 50
CSS Question

API: jquery-serialize-object is required to add form data to an existing data object (Semantic UI)

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?

Answer

Based on http://semantic-ui.com/behaviors/api.html#/usage, Look on the Passing Data section.

In Routed Form Data, It tells us that :

Structured form data requires including macek's serialize object.


But just for your shortcut information, this is the step i do :

First :

Download JQuery for Serialize Object in here and then save to your local file.

Add as internal javascript, so it can lighten your page.


Second:

Include that file to your page :

<script src="link_to_your_file/jquery.serialize-object.min.js"></script>