Jump to content

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?

Share this post


Link to post
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

Share this post


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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...