I am using jeditable to edit form and stuck at custom form submit to server.
There is product description box I need to edit. when some click edit it pops-up a window with product description in editable mode with a extra drop-down box (asking for reason what is user changing). However, I need only description to display on webpage but not reason.
$.editable.addInputType('autogrow', {
element : function(settings, original) {
var hourselect = $('');
var textarea = $('<textarea id="text" />');
$(hourselect).append(
$('').text('Select a reason').val(''),
$('').text('Adding new Description').val('1'),
$('').text('Editing Grammar').val('2')
);
$(this).append(hourselect);
if (settings.rows) {
textarea.attr('rows', settings.rows);
} else {
textarea.height(settings.height);
}
if (settings.cols) {
textarea.attr('cols', settings.cols);
} else {
textarea.width(settings.width);
}
$(this).append(textarea);
/* Last create an hidden input. This is returned to plugin. It will */
/* later hold the actual value which will be submitted to server. */
var hidden = $('');
$(this).append(hidden);
return(hidden);
},
plugin : function(settings, original) {
$('textarea', this).autogrow(settings.autogrow);
},
submit: function (settings, original) {
var value = $('#text').val();
$('input', this).val(value);
}
});
I can only send one value to server i.e. text or reason using hidden input field. However, I want to send reason and update description to server.
I was using timepicker as my example.