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

  • SEARCH
  • Home
  • 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 6766267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:48:34+00:00 2026-05-26T14:48:34+00:00

if i write: function myindex(name){ var cut_point = name.lastIndexOf(‘_’)+1; return name.substring(cut_point); } … var

  • 0

if i write:

function myindex(name){
var cut_point = name.lastIndexOf('_')+1;
return name.substring(cut_point);
}
...
var ind = myindex(some_id);    
var data_users = {};
var $data_users = $(data_users);
$data_users.prop('user_'+ind,{this.id:$(this).val()});

were this.id = ‘login'( from <\input type=”text” id=”login”> value=”<\?=$user->Login ?>”/>) it will be wrong. but i neeed:

data_users = {
user_3: {
login: Rocsana
}
}

for example, if I write so:

$data_users.prop(this.id,$(this).val());

then key setting correct:

data_users = {login: “Rocsana”}

but i need this in object ‘user_3’. please help.

p.s. I need to track every change in fields linked to the user, adding them (changes) in the object and then the changes I am sending ajax in php, using json. for example

data_users {user_3 {login: Rocsana, role: Admin, e-mail:
test@test.com}, user_2 {…}}

keys “login”, “role”, … identical to the fields of the table “Users”. it’s easier to make a database query “UPDATE”. just parse the object and received the names of the fields that need to update.

  • 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-26T14:48:34+00:00Added an answer on May 26, 2026 at 2:48 pm

    With what your asking, you dont need to use JQuery for the creation and addition of the your issue. Using native JS would be easier anyway. Example below…

    // Make the data_users object
    var data_users = {};
    
    // Creates the property "test" on the data_users object
    // Add it this way and you can reference it like "data_users.test"
    data_users['test'] = {};
    
    
    // Add a key/value pair (object) to data_users.test
        // You can put this  below line in a $.each or for loop and iterate through
        // your jquery elements and add them all the the data_users.test object this way.
    data_users.test[this.id] = $(this).val();
    /*
        Example:   data_users.test["SOMEID"] = "SOMEVALUE";
        Reference: data_users.test.SOMEID would return the string "SOMEVALUE"
    */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write function similar to http://whatismyudid.com/ that, then approved, will return the
normally to create an object you would write: function Dog(name) { this.name = name;
I should write function that takes list, element and return positions in with such
In C/C++, there is a 'write() function which let me write to either file
You write a function and, looking at the resulting assembly, you see it can
I want to write a function in Python that returns different fixed values based
I want to write a function that takes an array of letters as an
I want to write a function that accepts two objects as parameters and compare
I want to write a function that returns the nearest next power of 2
I need to write a function that takes 4 bytes as input, performs a

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.