Jump to content
xhpotterx

[Resolvido] Form dentro de um form mas oculto

Recommended Posts

xhpotterx

Boas pessoal vinha aqui perguntar se e possível eu ter o meu formulário principal e nesse form ter outro for mas oculto (ou uma cena parecida), onde tinha uma seta e quando clicasse la esse form que esta oculto aparecia, e peritia ser preenchido.

Obrigado espero respostas

Cumpz

Share this post


Link to post
Share on other sites
rezanov

outro form dentro de um form ? nested ? isso não podes. podes ter partes "escondidas" dentro de um div e torná-las visivéis com javascript por exemplo.

Share this post


Link to post
Share on other sites
rezanov
<html>
<head>
   <title>Javascript Div Collapse Style Using Display None</title>



   <script language="javascript" type="text/javascript">
   function displayDiv()
   {
       var divstyle = new String();
       divstyle = document.getElementById("div1").style.display;
       if(divstyle.toLowerCase()=="block" || divstyle == "")
       {
           document.getElementById("div1").style.display = "none";
       }
       else
       {
           document.getElementById("div1").style.display = "block";
       }
   }
   </script>


</head>
<body>
<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
<div id="div1">
Last name 2: <input type="text" name="lastname2">
</div>
</form>

<input type="button" value="display Div" onclick="displayDiv()" />

</body>
</html>

Edited by brunoais
geshi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.