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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:08:43+00:00 2026-05-28T07:08:43+00:00

You can check page here: http://jsfiddle.net/7JhjN/ Basicly, there is a hell of duplication going

  • 0

You can check page here: http://jsfiddle.net/7JhjN/

Basicly, there is a hell of duplication going on and I don’t like this. I am sure there is something wrong since it’s not a correct programming logic.

How can I shorten this function?

The system works like this:
1. There are 6x select boxes. (option values are the same)
2. There are 6x divs for output.
3. Whenever a select box value gets changed, image in target div gets changed.

  • 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-28T07:08:43+00:00Added an answer on May 28, 2026 at 7:08 am

    how about this:

    HTML:

    <select class='item_early' name="item_early1" data-id="1"><option value="0"></option></select>
    <select class='item_early' name="item_early2" data-id="2"> <option value="0"></option></select>
    <select class='item_early' name="item_early3" data-id="3"> <option value="0"></option></select>
    <select class='item_early' name="item_early4" data-id="4"> <option value="0"></option></select>
    
    <div id="result_item_early1"></div>
    <div id="result_item_early2"></div>
    <div id="result_item_early3"></div>
    <div id="result_item_early4"></div>
    

    Javascript:

    $('.item_early').change( function() {
      var value = $(this).val();
      var id = $(this).data('id');
    
      $('#result_item_early'+id).html('<img src="http://www.sobafire.com/themes/default/images/loading.gif">');
      $('#result_item_early'+id).load('http://www.sobafire.com/ajax.php?ajaxType=ITEM&itemID=' + value);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Check out my problem here: http://jsfiddle.net/89sq2/ What should happen is that the months legend
Can check out here alt text http://51hired.com/static/problem.bmp
check this page out: http://jsbin.com/itufix with IE (page automatically enables IE7 mode). Here you'll
This one is bit tricky , I created jsfiddle here http://jsfiddle.net/WXmcL/10/ to kinda replicate
Check the test page here http://rickchristie.com/testfocus.html Correct me if I'm wrong: onfocus happens when
I have a login dropdown much like Twitter. You can check it out here
How can I check for the existence of an aspx page before attempting to
How can I check whether all JavaScript functions have loaded properly on a page?
Is there any way where I can check if the field is numeric in
I saw an article here: http://code.lancepollard.com/automatically-publish-posts-to-stumbleupon-with-ruby I don't know Ruby, but the following lines

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.