why is the code crashing when using jeditable?

32 views Asked by At

The code crashes when html tags are entered as input when making fields editable by using jeditable.

It opens my custom error page in the text area itself with the error message "A potentially dangerous Request.Form value was detected from the client "

When user tries to normally save new information the call goes to EditData method at Controller but when user enters html tag and tries to save the code crashes and call does not go to EditData at Controller

    $('.editArea').editable('../Data/EditData', {
        cssclass: 'jeditForm',
        tooltip: 'click to edit',
        width: '100%',
        height: '150',
        type: 'textarea',
        title: '',
        placeholder: 'click to edit',
        submit: 'save',
        onsubmit: function (settings, original) {
            oldValue = original.revert;
        },

        submitdata: function (value) {
            return {
                id: $(this).data('id'),
                propertyName: $(this).data('propertyname')
            }
        },
        callback: function (value, settings) {
            var jsonData = $.parseJSON(value);
            if (jsonData.status) {
                this.innerText = jsonData.value;
            }
            else {
                alert("not updated");
                this.innerText = oldValue;// + "\n" + jsonData.msg;
            }
        }
    });
0

There are 0 answers