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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:04:58+00:00 2026-06-17T11:04:58+00:00

Im just learning javascript the last days (started PHP some months ago). So, my

  • 0

Im just learning javascript the last days (started PHP some months ago).

So, my code make this:

e.g

 http://controljuridico.com/video01/

I have three files.

  1. An Html file with the form.

  2. A javascript file with the functions after click on “enviar” (send) button.

  3. A php that process the data.

HTML file (index.html)

        <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">

       <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
        <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>index</title>
<link href="css/css.css" type="text/css" rel="stylesheet" media="screen" />
<script src="js/jquery.js" type="text/javascript" language="JavaScript"></script>
<script src="js/js.js" type="text/javascript" language="JavaScript"></script>
    </head>
      <body>
   <div id="content">
    <h1>Test.</h1>
    <h1>Step 1) choose city</h1>
    <br />
    <br />
    <label>test(*)</label>
    <hr />
    <br />
    <form name="form_data" id="form_data">

        <label>(*) City</label>
        <br />
        Medellin
        <input type="radio" name="ciudad" value="Medellin" />
        Manizales
        <input type="radio" name="ciudad" value="Manizales"/>
        Cali
        <input type="radio" name="ciudad" value="Cali"/>
        <br />
        <label>(*) Especialidad</label>
        <br />
        <input type="button"  value="Enviar" id="btn_enviar" /> 
        <br />
        <br />
        <label id="mensaje"></label>
    </form>
    <div id="resultado" ></div>
        </div>
               </body>
            </html>

js.js File

       $(document).ready(function(){
   $('#btn_enviar').click(function(){

    if( validaRadio( 'ciudad','Ciudad' ) == false) return false;


    $.ajax({
        type:'POST',
        url :'upload.php',
        data: $('#form_data').serialize(),
        beforeSend : function(){
            $('#mensaje').html('Enviando datos...');
        },
        success: function (data){
                        $('#mensaje').html('Datos enviados  correctamente.');
                $('#resultado').html(data); 
        },
        complete: function(){
             $('#form_data').slideUp();
             $('#resultado').slideDown();

        }
    });

        }); 


          });

Php File (upload.php)

 <?php

  $sergu = $_POST['ciudad'];
   if ($_POST['ciudad'] == "Medellin") {
    ?>
    <label>Ciudad Ingresada:</label>
    <br />
    <label><?php echo $_POST['ciudad'] ?></label>
    <hr />
    <?php
    }else{
    echo "it is not medellin....";

   }
       ?>

So, this works very well but. What if I want this:

After click on “enviar” button also show another similar form at the left of this form.

I mean its just like choosing steps if you choose the step one I need another step and so on and I want that this another step just appear to the left of the previus form.

It is possible? how?

Thanks in advance for your help! I really appreciate it.

  • 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-17T11:04:59+00:00Added an answer on June 17, 2026 at 11:04 am

    You could for example just hide the ‘second form’ when the page first loads via css like this:

    <form id="second_form" style="display: none">...
    

    and when your success function fires you remove the css like so:

    success: function(){
      ...
      $('#second_form').show();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just started learning jQuery/javascript, so this might seem like a really basic question,
Started learning javascript yesterday at CodeAcademy and decided I could actually write code. Just
I just learning about javascript php html css etc so I'm looking for some
Can anyone tell me how to do this? I've just started learning javascript. I
I just started learning JavaScript and am wondering why this simple snippet hangs when
I have just started learning Jquery and am new to writing javascript (I am
I'm only just learning javascript so I imagine this is relatively simple but it's
I have just started learning Javascript. I want Hello World! to be written to
I have just started learning Javascript and I am absolutely overwhelmed with the number
Hey, I've just started learning JavaScript and I'm making a little script that generates

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.