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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:42:37+00:00 2026-06-09T10:42:37+00:00

Today I face another big problem on the way to developing my site. I

  • 0

Today I face another big problem on the way to developing my site. I have a normal form with some basic CSS. Now I want to use the form in that way, some fields will be hidden by default, the respective textfield will be activated as per menu selected from dropdown list. I first thought to do it it PHP in some other way but that will not be proper for my requirment. I want somecode which will act on that same page without refreshing. So I need some JavaScript or jQuery or Ajax work. But I’m not good in this languages so I need your help.

After doing huge googleing I find a piece of JavaScript code which is working for me. That is http://jsfiddle.net/ZxLU9/

But The problem is it is only working for two option as it was given on the site. I tried to add id3. But when ever I’m increasing an id, the code is not working anymore. Also, though this code is using tbody the hidden form design is totally broken. I’m sharing my full code here. Within the code there are some PHP code, ignore that, I’m not concern about that right now. Just fix me this issue with my actual design.

Please
You can visit the full code here : http://jsfiddle.net/QvJH6/2/

CHECK THE FIELD NAMED EXTRA . . . . That is the one where I want to put that code.

  • 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-09T10:42:39+00:00Added an answer on June 9, 2026 at 10:42 am

    //change the function call from

    //onchange=”display(this,’text’,’image’);”

    //to
    // onchange=”display(this,’text’,’image’,invisible);”

    //and also change your display function in javascript to

    function display(obj,id1,id2,id3) {
               txt = obj.options[obj.selectedIndex].value;
               document.getElementById(id1).style.display = 'none';
               document.getElementById(id2).style.display = 'none';
               document.getElementById(id3).style.display = 'none';
               if ( txt.match(id1) ) {
                  document.getElementById(id1).style.display = 'block';
               }
               if ( txt.match(id2) ) {
                  document.getElementById(id2).style.display = 'block';
               }
               if ( txt.match(id3) ) {
                  document.getElementById(id2).style.display = 'block';
               }
    

    }

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

Sidebar

Related Questions

Today i have a little problem containing a File Upload. First some Infos: Rubyversion:
today i have direct a problem :P i just need some ideas... how do
Today I have had a problem with hiding text with text-indent: -9999px rule. I
Today, I have a problem with hosting my custom service host using custom binding
Today is my first day using the Google Maps API. Now I have a
I have been running a webserver for some years now but recently it started
today i hit a really annoing problem with wpf. i just want to align
Today, I have read that command's object in WPF can be serialized. And I'm
I was looking through some code today and saw something like the following: var
The fonts used to work, today they stopped working w/o any CSS changes. 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.