How would one create a hidden form on a web page and only open the form when the button is clicked?

Recommended Answers

All 3 Replies

Member Avatar

This is likely to be a javascript hide and show affair (toggle display).
Else it could be an Ajax call to get the form from the server and update the html page.

I'm assuming that you do not want anything to happen other than to show a form on button click? If so, you can set the form's display: none in css.

Then when you click the button, have the click event change the display of the form to block.

i need a form that is hidden until the user clicks a date on a calendar. onky Then the form will be visible and have a field for the day that way pressed on submit the form would go back to being invisible.

not sure how to implement this

Member Avatar

So are you looking for a javascript modal form (like a lightbox/popup)?

There are hundreds of implementations of this. If you're using jQuery and more importantly, jQueryUI - there's a modal form. If you're using a front-end framework like Twitter Bootstrap, then there's a modal form example. Hell, just search for "javascript modal form" and you'll get more hits than an overrated middling 60/70's band with bad haircuts from Liverpool.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.