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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:06:57+00:00 2026-06-12T05:06:57+00:00

I have the following code :- //– function to enable editing of content if

  • 0

I have the following code :-

//-- function to enable editing of content if disabled for new records --\\
function edit(e,elems)
{
  if ( e.value == "new" )
  {
    $(e).parent().parent().find(":input[readonly]").each(function(index) {
      $(this).prop('readonly',false);
      $(this).addClass('highlight');
    });
      $(e).parent().parent().find("select[disabled]").each(function(index) {
      $(this).prop('disabled',false);
      $(this).addClass('highlight');
//-- Insert dynamic options --\\
      if ($(this).attr('name') == 'low')
      {
        var optVal = "option[value='" + $(this).val() + "']";
        var optclone = $("#affoptions").clone();
        $(optclone).find(optVal).attr("selected",true);
        $(this).html($(optclone).find("option"));
      }
      if ($(this).attr('name') == 'high')
      {
        var optVal = "option[value='" + $(this).val() + "']";
        optclone = $("#insoptions").clone();
        $(optclone).find(optVal).attr("selected",true);
        $(this).html($(optclone).find("option"));
      }
    });
    $(e).parent().parent().find(elems).focus();
  } else {
      $(e).parent().parent().find(elems).each(function(index) {
      if ( $(this).is('select') )
      {
        $(this).prop('disabled',true);
      } else {
        $(this).prop('readonly',true);
      }
      $(this).removeClass('highlight');
    });
  }
}

Which works just fine in Google Chrome but doesn’t work in IE 8.
Essentially I have a form with radio buttons and one of them is for new entries. This basically enables an input text field and removes the disabled flag for select fields.
The select options have only 1 value in them when disabled. The radio button inserts all available options from a hidden div and marks the selected index value in the new options to match the single entry from the initial load.

In IE the select options are wiped out completely leaving nothing not even the initial entry.

I haven’t been able to get this to work properly and assume it’s a problem with the cloned element.

What am I doing wrong?

Thanks
Craig

  • 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-06-12T05:06:58+00:00Added an answer on June 12, 2026 at 5:06 am

    Never mind I figured it out eventually.
    My code is fine, the problem it turns out was IE didn’t like the fact that my hidden DIV with the options in it that I was cloning, was missing the SELECT tags. Go figure.

    So changing this :-

    <div id="affoptions" class="options">
      <option value="0001">0001 | A</option>
      <option value="0002">0002 | B</option>
      <option value="*">* | All</option>
      <option value="0003">0003 | C</option>
      <option value="0004">0004 | D</option>
    </div>
    

    To this :-

    <div id="affoptions" class="options">
     <select>
      <option value="0001">0001 | A</option>
      <option value="0002">0002 | B</option>
      <option value="*">* | All</option>
      <option value="0003">0003 | C</option>
      <option value="0004">0004 | D</option>
     </select>
    </div>
    

    Resolved it.

    Cheers
    Craig

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code function Model(onChanged) { this.array = new Array(); this.onChanged = onChanged;
I have following code snippet: self.xmlHttpReq = new XMLHttpRequest(); self.xmlHttpReq.onreadystatechange = function() { if(self.xmlHttpReq.readyState
I have following code: public abstract class Operand<T> { public T Value { get;
I have following code snipped: ... var tpc = new ThirtPartyClass(); tpc.ExecuteCommand(); tpc.ExecuteCommand(); ...
I have following code in C# PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
I have following code in C# PasswordDeriveBytes DerivedPassword = new PasswordDeriveBytes(Password, SaltValueBytes, HashAlgorithm, PasswordIterations);
I have following code: canvas=new MembershipFunctionComponent(functions); canvas.setPreferredSize(new Dimension((int)this.getWidth(), (int)this.getHeight())); canvas.addMouseListener(canvas); pane.add(canvas); MembsershipFunctionComponent extends JComponent.
I have following code $("#in").datepicker({ minDate: 0, onSelect: function (dateText, inst) { dateText =
I have following code: <style> .header { height:20px; width:100px; } .content { height:100px; width:100px;
I have following code: my $coderef = ${MyModule::MyTool->new}; but when I try $coderef->(); i

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.