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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:22:23+00:00 2026-06-08T00:22:23+00:00

I wanted to do the following: Having a select box, <select name=some id=some> <option

  • 0

I wanted to do the following:

Having a select box,

<select name="some" id="some">
    <option value="xx">xx</option>
    <option value="yy">yy</option>
    <option value="ww">ww</option>
    <option value="zz">zz</option>
    <option value="uu">uu</option>
</select>

And when I select the option xx, open another select box

<select name="some_xx" id="some_xx">
    <option value="xx">xx</option>
    <option value="yy">yy</option>
    <option value="ww">ww</option>
</select>

Then, If I select in the some_xx the YY or WW or XX option it loads some html info ( a form ). ANd in the some select if I select the others options (not xx) it also loads some html info ( a form ).

All the forms are different, so I would like to load an external file with all the forms, is it possible? How to do all of this?

I know it will involve some javascript, but I really don’t know how and I’ve searched quite a bit and seen some functions like load() and create selects but can’t figure it out.

Thanks in advance

edit: I have this code but it’s not dynamic and it’s not working right…

<script>
$(function(){ 
       function changeForm($(this)) {
            $('#form').load('$(this).html');
       }  

       function changeForm_xx($(this)) {
            $('#form2').load('$(this).html');
       } 

      $('#some').change(function() {
           changeForm($(this));
      });    
      $('#some_xx').change(function() {
           changeForm_xx($(this));
      });
});
</script>

And also, I want to remove the load content when I change the select

UPDATE: working: close

  • 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-08T00:22:25+00:00Added an answer on June 8, 2026 at 12:22 am

    change it to like this. you have many errors in your script . see Demo : JsFiddle Demo

    Error List

    1. function changeForm($(this)) // here you added Extra parenthesis and as Jquery obj.
    2. $('#form2').load('$(this).html') // this is wrong. you need to call as below . it is yourObj.html() method.

       function changeForm(obj) {
         var someVar= $(obj).html();
              $('#form').load(someVar); //here you perform load Operation. 
      
         }  
      
         function changeForm_xx(obj) {
            var someVar= $(obj).html();
              $('#form').load(someVar); //here you perform load Operation. 
         }
      
        $('#some').change(function() {
             changeForm($(this));
        });    
        $('#some_xx').change(function() {
             changeForm_xx($(this));
        });
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in HTML and wanted to replace them using javascript
I am having some issues with JQuery and CakePHP. I wanted to know if
I am having some difficulty accessing the value of the selected radio button in
I am having some trouble making an iterator that can traverse the following type
I wanted to write following query through codeigniter's db helper class, guide me plz
i wanted to know the logic of following radix sort program. #include <stdio.h> #include
I wanted to ask whether the following statement where printf() has been provided with
I wanted to know why the following code crashes. int main( ) { int
I wanted to know if anybody can explain me the following piece of Javascript
I have the following NumberTextBox and i wanted to allow only the digits,but 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.