1. Code that triggers the modal frame pop-up window
Here's a copy of the code for a bootstrap modal box.
<H2>Create modal frame (Modal)</H2><!--button trigger modal box -<Buttonclass= "btn btn-primary btn-lg"Data-toggle= "Modal"Data-target= "#myModal">Start Demo Modal box</Button><!--modal frame (Modal) -<Divclass= "Modal Fade"ID= "Mymodal"TabIndex= "-1"role= "Dialog"Aria-labelledby= "Mymodallabel"Aria-hidden= "true"> <Divclass= "Modal-dialog"> <Divclass= "Modal-content"> <Divclass= "Modal-header"> <Buttontype= "button"class= "Close"Data-dismiss= "Modal"Aria-hidden= "true">×</Button> <h4class= "Modal-title"ID= "Mymodallabel">Modal frame (Modal) title</h4> </Div> <Divclass= "Modal-body">Add some text here</Div> <Divclass= "Modal-footer"> <Buttontype= "button"class= "Btn Btn-default"Data-dismiss= "Modal">Shut down</Button> <Buttontype= "button"class= "Btn btn-primary">Commit Changes</Button> </Div> </Div><!--/.modal-content - </Div><!--/.modal -</Div>
Where the button that triggers the modal box is the following line of code
<class= "btn btn-primary btn-lg" data-toggle= "modal" Data-target= "#myModal"> start demo modal box </button>
Data-toggle= "Modal" is the specific code that triggers the modal box, and when you click the button, the modal box does not pop up, or you can write the click event with Ajax.
2. The function of submitting the form
<form action= "chuli.php" method= "POST" >
<class= "btn btn-primary btn-lg" data-toggle= "modal" Data-target= "#myModal"> start demo modal box </button>
</form>
When the "Start Demo box" button is clicked, a form form is submitted, and at some point it is not required to have the function of submitting the form, and the Type= "button" is added.
<formAction= "chuli.php"Method= "POST"> <Buttontype= "button"class= "btn btn-primary btn-lg"Data-toggle= "Modal"Data-target= "#myModal">Start Demo Modal box</Button></form>
Bootstrap Modal Box button