Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
This repository was archived by the owner on Jul 29, 2022. It is now read-only.

jEditable Custom Form submit #47

@pviral

Description

@pviral

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.

How can I do this?

Example code


$.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.

Has anybody came across this problem or use-case and provide some guidance?

I was using timepicker as my example.

Viral

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions