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 7059017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:10:55+00:00 2026-05-28T04:10:55+00:00

Here’s some background. I hope someone has some ideas. I know some basic jQuery

  • 0

Here’s some background. I hope someone has some ideas. I know some basic jQuery but this is a bit beyond me:

I have the following function:

function updateField(entity, obj, type) {
    var val = obj.val();
    var idArr = obj.attr("id");
    var idTmp = idArr.split("_");
    var id = idTmp[1];
    var pk = $('#Meta_PartitionKey').val();
    var rk = $("div[id='rk_" + id + "']").html(); 
    enableLoadingIcon();
    $.ajax({
        cache: false,
        url: "/Administration/" + entity + "s/Update",
        data: { pk: pk, rk: rk, fld: type, val: val },
        success: function () {
            disableLoadingIcon(); 
        } 
    }); 
};

This is set up to look for changes here:

  $(document).ready(function () {
      $("input[id^='Position_'], select[id^='Level_'], select[id^='Status_'],").change(function (e) {
          var type = $(this).attr('id').split('_')[0];
          updateField('Link', $(this), type);
      });
  });

and HTML:

<div class="rep_td0"> 
   <select id="Level_0" name="AdminDetails[0].Level"><option value="0">0</option>
   <option value="1">1</option>
   <option selected="selected" value="2">2</option>
   </select>
</div>
<div class="rep_td0 level_2">Link2</div> 

When the function updateField is called with an entity type of “Level” then I need to change the class of the following
rep_tdo, remove whatever level is set and change to a Level that matches the choice.

Can someone help me out here.

  • 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-28T04:10:55+00:00Added an answer on May 28, 2026 at 4:10 am

    Iterate through the options and toggle class for each of them

    var obj = $(this).parent().next();
    $(this).children().each(function()
    {
        obj.toggleClass("level_" + this.value, this.selected);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is an example: I have a file 1.js, which has some functions. I
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a coding problem for those that like this kind of thing. Let's see
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
here is the site : http://www.notrepanorama.com at the bottom left, i use a jquery
Here's some of my production code (I had to force line breaks): task =
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here is what I want to do. Use this HTML line and have the
Here is my code sample, let me know if it can be further improved?
Here is what I am trying to achieve in PHP: I have this string:

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.