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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:27:37+00:00 2026-05-27T11:27:37+00:00

So I’m working on a form that when you click it it brings up

  • 0

So I’m working on a form that when you click it it brings up another form, then another, etc etc.

For the example, this is what I have so far:

<head>
<script langauge="javascript">
function showGeneral(){
    document.getElementById('general').style.display="block";
    document.getElementById('colors').style.display="none";
    document.getElementById('domain').style.display="none";
    document.getElementById('details').style.display="none"; 
}

function showColors(){
    document.getElementById('general').style.display="none";
    document.getElementById('colors').style.display="block";
    document.getElementById('domain').style.display="none";
    document.getElementById('details').style.display="none";  
}

function showDomain(){
    document.getElementById('general').style.display="none";
    document.getElementById('colors').style.display="none";
    document.getElementById('domain').style.display="block";
    document.getElementById('details').style.display="none"; 
}

function showDetails(){
    document.getElementById('general').style.display="none";
    document.getElementById('colors').style.display="none";
    document.getElementById('domain').style.display="none";
    document.getElementById('details').style.display="block"; 
}

</script> 
</head>

<body>
<div id="general" name="general">
<h1> General </h1>   
<form id="general" name="general">
    Name <input type="text" id="frm1txt1" name="frm1txt1"/> <br>
  Email <input type="text" id="frm1txt2" name="frm1txt2"/> <br>
  <input type="button" id="frm1btn1" name="frm1btn1" value="Continue" onclick="showColors();"/> <br>
</form>
</div>



<div id="colors" name="colors" style="display:none">
<h1> Colors </h1>   
<form id="frm2" name="frm2">
    Green? <input type="text" id="frm2txt1" name="frm2txt1"/> <br>
  Red? <input type="text" id="frm2txt2" name="frm2txt2"/> <br>
  <input type="button" id="frm2btn1" name="frm2btn1" value="Continue" onclick="showDomain();"/> <br>
</form>
</div>


<div id="domain" name="domain">
<h1> Domain Name? </h1>   
<form id="frm1" name="frm1">
    Yes <input type="text" id="frm1txt1" name="frm1txt1"/> <br>
  No <input type="text" id="frm1txt2" name="frm1txt2"/> <br>
  <input type="button" id="frm1btn1" name="frm1btn1" value="Continue" onclick="showDetails();"/> <br>
</form>
</div>

<div id="details" name="details">
<h1> Describe Your Order </h1>   
<form id="frm1" name="frm1">
    Img <input type="text" id="frm1txt1" name="frm1txt1"/> <br>
  kk <input type="text" id="frm1txt2" name="frm1txt2"/> <br>
  <input type="button" id="frm1btn1" name="frm1btn1" value="Finish" onclick="showGeneral();"/> <br>
</form>
</div>

</body>

The functions work fine – but the problem is it displays all the forms at on page refresh/load. How do I make it so just the first one displays when you load that page?

Cheers!

  • 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-27T11:27:38+00:00Added an answer on May 27, 2026 at 11:27 am

    When the page loads there is no call to any of the JS functions so none of them are being processed and all your forms are displayed. You need to add an explicit call to one of the functions. So to display the first form only you’d need to add

    showGeneral();
    

    In your script block (after the showDetails() function for example).

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have this code to decode numeric html entities to the UTF8 equivalent character.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.