Jump to content

smus

Recommended Posts

Let's pretend, there's a <div> on a page. There's a usual HTML form inside it that sends information to another php-file. By default, the visibility of the div is hidden, and the click on the button makes it visible. The question is how to close the form (i.e. hide the div) using a button or <a> element on the div, WITHOUT the sending data to php-file. In other words, how to close this <div> as if it is usual popup-window, without changes?

Link to comment
Share on other sites

In some browsers using a button element in a form will submit it. If you wish to close it witout submitting place it outside of form within div. It can be text close or close image x in top left corner, then force it to hide parent element or element with id or class to its normal state.

  • Like 1
Link to comment
Share on other sites

In some browsers using a button element in a form will submit it. If you wish to close it witout submitting place it outside of form within div. It can be text close or close image x in top left corner, then force it to hide parent element or element with id or class to its normal state.

 

Yes, it works, thanks! Just transferred the same button out of the form.

Link to comment
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...