Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
179
rated 0 times [  181] [ 2]  / answers: 1 / hits: 18840  / 7 Years ago, mon, may 15, 2017, 12:00:00

I have created a form. On submit of the form I want to display the whole form, but it currently isn't doing so. Here is my code:





function Openform()
{
document.getElementById('form1').style.display = '';
}

<div id = form1 style = display:none>
<form id=formirri method=post action= target=_parent>
<br/><br/>
<div id=demo>
<table width=230px align=center style=box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 100);><tr><td colspan=1></td></tr>
<tr>
<td><a href=# class=close-classic></a></td>
</tr>
</table>

</div>

<input id=dynamic name=Irrigation Form type=button value=Calulation Form ; onclick = Openform();
style=overflow:hidden;padding: 5px 5px; border-radius: 3px;font-size: 8.5pt; width:200px ; background-color: #E7FCCA; font-weight: bold; >




More From » html

 Answers
30

You made a mistake in style.Change like below:



function Openform()
{
document.getElementById('form1').style.display = '';
}

<div style = display:none>


display and visibility both are different.



display:none will not be available in the page and does not occupy any space.



visibility:hidden hides an element, but it will still take up the same space as before.



HTML:



<div id = form1 style = display:none>
<form id=formirri method=post action= target=_parent>
<br/><br/>
<div id=demo>
<table width=230px align=center style=box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 100);><tr><td colspan=1></td></tr>
<tr>
<td><a href=# class=close-classic></a></td>
</tr>
</table>

</div>
</form>
</div>

[#57786] Friday, May 12, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
madelyn

Total Points: 449
Total Questions: 100
Total Answers: 100

Location: Seychelles
Member since Fri, May 7, 2021
3 Years ago
;