Bootstrap Modal Box button

Source: Internet
Author: User

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">&times;</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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.