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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:32:51+00:00 2026-05-15T13:32:51+00:00

Comarades, I tried using the append and prepend (), but none of the controls

  • 0

Comarades,

I tried using the append and prepend (), but none of the controls work. Could anyone help me? In Internet Explorer and Firefox works.

The Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>

 <script type="text/javascript" src="raphael-min.js"></script>
 <script type="text/javascript" src="jquery-1.4.2.js"></script>
 <script type="text/javascript">

 selEstrutura = function(strComponent, strDestino)
 {
var objDest = $('#' + strDestino);
var objComp = $('#' + strComponent);
if ((objComp != null) && (objDest != null))
{
    $('#' + strDestino + ' img').remove();
    objDest.append('<img id="' + strDestino + '" src="' + objComp.val() + '"');
    if ((strDestino.trim() == 'eixoTracionado1') || (strDestino.trim() == 'eixoTracionado2'))
    {
        $('#eixoEstruturaPt1 img').remove();
        $('#eixoEstruturaPt1').append('<img id="eixoEstruturaPt1" src="estrutura_semrodas.gif"');

        $('#eixoEstruturaPt2 img').remove();
        $('#eixoEstruturaPt2').append('<img id="eixoEstruturaPt2" src="estrutura_semrodas.gif"');
    }
}
 }

</script>

<body>
<div align="left" style="width:20%;float:left;height:300px;border:groove;border-color:#000000;margin-left:0px;">
    <div align="right" style="float:left;width:30%">Tração:&nbsp;</div>
    <div style="float:right;width:70%">
        <select id="cboTracao" onchange="selEstrutura('cboTracao','eixoTrator');">
            <option value="">&nbsp;</option>
            <option value="eixotrator_rodaunica.gif">Única</option>
            <option value="eixotrator_rodasimples.gif">Simples</option>
            <option value="eixotrator_rodadupla.gif">Dupla</option>
        </select>
    </div>
    <div align="right" style="float:left;width:30%">Tracionado(1):&nbsp;</div>
    <div style="float:right;width:70%">
        <select id="cboTracionado1" onchange="selEstrutura('cboTracionado1','eixoTracionado1');">
            <option value="">&nbsp;</option>
            <option value="eixotracionado_rodadosimples.gif">Simples</option>
            <option value="eixotracionado_rodadoduplo.gif">Duplo</option>
        </select>
    </div>
    <div align="right" style="float:left;width:30%">Tracionado(2):&nbsp;</div>
    <div style="float:right;width:70%">
        <select id="cboTracionado2" onchange="selEstrutura('cboTracionado2','eixoTracionado2');">
            <option value="">&nbsp;</option>
            <option value="eixotracionado_rodadosimples.gif">Simples</option>
            <option value="eixotracionado_rodadoduplo.gif">Duplo</option>
        </select>
    </div>
    <div align="right" style="float:left;width:30%">Qtd Estepes:&nbsp;</div>
    <div style="float:right;width:70%">
        <select id="cboEstepes" onchange="selEstrutura('cboEstepes','eixoEstepes');">
            <option value="">&nbsp;</option>
            <option value="estepe_simples.gif">01</option>
            <option value="estepe_duplo.gif">02</option>
            <option value="estepe_triplo.gif">03</option>
        </select>
    </div>
</div>

<div id="prompt" align="center" style="width:79%;float:right;border:groove;border-color:#000000;height:300px">
    <div style="margin-left:30%">
        <div id="eixoEstepes" style="float:left;margin-left:10px"></div>
        <div style="width:20%;float:left"></div>
        <div id="eixoTrator" style="float:left"></div>
        <div id="eixoEstruturaPt1" style="float:left"></div>
        <div id="eixoEstruturaPt2" style="float:left"></div>
        <div id="eixoTracionado1" style="float:left"></div>
        <div id="eixoTracionado2" style="float:left"></div>
    </div>
</div>
 </body>
 </html>

Sugestions (Modified)

Performing some suggested changes, still not working.

<script type="text/javascript">

selEstrutura = function(strComponent, strDestino)
{
var objDest = $('#' + strDestino);
var objComp = $('#' + strComponent);
if ((objComp != null) && (objDest != null))
{
    $('#' + strDestino + ' img').remove();
    objDest.append('<img id="' + strDestino + '_img" src="' + objComp.val() + '"');
    if ((strDestino.trim() == 'eixoTracionado1') || (strDestino.trim() == 'eixoTracionado2'))
    {
        $('#eixoEstruturaPt1 img').remove();
        $('#eixoEstruturaPt1').append('<img id="eixoImgEstruturaPt1" src="estrutura_semrodas.gif"');

        $('#eixoEstruturaPt2 img').remove();
        $('#eixoEstruturaPt2').append('<img id="eixoImgEstruturaPt2" src="estrutura_semrodas.gif"');
    }
}
} 

</script>
  • 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-15T13:32:51+00:00Added an answer on May 15, 2026 at 1:32 pm

    Source Working in: Opera, Safari, Chrome, IE, Mozilla.

    selEstrutura = function(strComponent, strDestino)
    {
    $('#' + strDestino + ' img').remove();
    $('#' + strDestino).append('<img id="' + strDestino + '_img" src="' + $('#' + strComponent).val() + '">');
    if ((strDestino == 'eixoTracionado1') || (strDestino == 'eixoTracionado2'))
    {
        $('#eixoEstruturaPt1 img').remove();
        $('#eixoEstruturaPt1').append('<img src="estrutura_semrodas.gif" alt=""/>');
    
        $('#eixoEstruturaPt2 img').remove();
        $('#eixoEstruturaPt2').append('<img src="estrutura_semrodas.gif" alt=""/>');
    }
    } 
    

    I made the changes suggested by friends, but in some browsers was not working. After some testing, I discovered that the method “. Trim ()” was not working properly.

    Thanks for the help of all.

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

Sidebar

Related Questions

Camarades, You'd know me identify good libraries (preferably in jQuery) to work with Canvas
Comrades, The following does not work: vector<string>::iterator c; for( c = holdtype.begin(); c !=
Camarades, My Visual Studio is in trouble in keyboard. I am working normally, when
One of our comrades, Peter Mortensen , asked a question on Super User about an
Let's consider this FOR loop in a Windows batch script: D:\MiLu\Dev\C++\temp :: type string.bat
Let me explain what I mean in my title. Let's say, that for example
I was asked the following Question: How would you store the data given below(which
Greetings great SO comrades; I'm trying to use this code to make changes to
I am sending an HTML text from PHP to Python via STDIN. My objctive
According to the Ruby docs for Time#zone : As of Ruby 1.8, returns UTC

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.