Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6621197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:13:52+00:00 2026-05-25T21:13:52+00:00

How to implement file upload in jqGrid using dataProxy from http://jqgrid-php.net below? Running code

  • 0

How to implement file upload in jqGrid using dataProxy from http://jqgrid-php.net below?

Running code below causes exception

Unable to get value of the property 'removeAttr': object is null or undefined 

at line

$(this).data('name', $(this).attr('name')).removeAttr('name');

as show in comment in code.

It looks like ele (form) contains elements without name which causes this exception.
How to fix this code ?
How to change this code so that it loops (saves/restores name) only over elements which have name.

var dataProxyAjax = function (opts, act) {  // from http://jqgrid-php.net
    opts.url = $(this).getGridParam('url');
    //use normal ajax-call for del
    if (act.substring(0, 4) == 'del_') {
        $.ajax(opts);
    }
    opts.iframe = true;
    var $form = $('#FrmGrid_' + $(this).getGridParam('id'));
    var ele = $form.find('INPUT,TEXTAREA').not(':file');
    //Prevent non-file inputs double serialization
    ele.each(function () {
        // todo: how to fix the error: Unable to get value of the property 'removeAttr': object is null or undefined 
        $(this).data('name', $(this).attr('name')).removeAttr('name');
    });
    //Send only previously generated data + files
    $form.ajaxSubmit(opts);
    //Set names back after form being submitted
    setTimeout(function () {
        ele.each(function () {
            $(this).attr('name', $(this).data('name'));
        });
    }, 200);
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:13:53+00:00Added an answer on May 25, 2026 at 9:13 pm

    you are trying to set the value of something that isnt a value. removeAttr just removes the attr…it seems like you are trying to set the data of ‘name’ for (this) element to be equal to (this) but with the attr ‘name’ removed. I’m not sure that makes a lot of sense.

    try:

    ele.each(function () {
            // todo: how to fix the error: Unable to get value of the property 'removeAttr': object is null or undefined 
            var theName = $(this).attr('name');
            $(this).removeAttr('name');
            $(this).data('name', theName);
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement an Asynchronous file download from a web server using
I am trying to implement a file upload solution using app engine and python.
I'm trying to implement file upload functionality in the iPhone app. Server code is
I am trying to implement Gmail style drag-and-drop file upload in ASP.NET MVC. I
I want to implement an asynchronous file upload for my asp.net application. My idea
I am trying to implement file upload with jqgrid (in a Zend Framework project).
i tried to implement the file upload via doctrine/lifecycle callbacks as described here: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html#using-lifecycle-callbacks
While trying to implement an MVC file upload example on Scott Hanselman's blog. I
I m Using a calendar.js file to implement calendar in my App. Actually this
How can I implement chmod command on file by using exec? I would appreciate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.