Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

bootstrap modal popup disable click outside

 <button data-target="#myModal" data-toggle="modal" data-backdrop="static" data-keyboard="false">
    Launch demo modal
 </button>
Comment

bootstrap modal popup disable click outside

$('#myModal').modal({backdrop: 'static', keyboard: false})  
Comment

prevent bootstrap modal from closing when clicking outside

<div id="idModal" class="modal hide" data-backdrop="static" data-keyboard="false">
Comment

prevent close modal when click outside

$('#myModal').modal({
    backdrop: 'static',
    keyboard: false
})

or in HTML
<a data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">
Comment

prevent close modal when click outside

<div class="modal fade" id="myModal" data-keyboard="false" data-backdrop="static">
Comment

Stop modal from closing on outside click

Set the modal's backdrop to static. The modal component has a prop of backdrop, set that to backdrop="static"

<div>
    <Modal show={this.state.show} onHide={this.handleClose} backdrop="static">
        <Modal.Header>
            <Modal.Title>Change Password</Modal.Title>
        </Modal.Header>
        <Modal.Body>
            <form className="form-horizontal" style={{margin:0}}>
                <div className='password-heading'>This is the first time you have logged in.</div>
                <div className='password-heading'>Please set a new password for your account.</div>
                <br/>

                <label className="password">Password
                    <input type={this.state.type} className="password__input" onChange={this.passwordStrength}/>
                    <span className="password__show" onClick={this.showHide}>{this.state.type === 'input' ? 'Hide' : 'Show'}</span>
                    <span className="password__strength" data-score={this.state.score}>
                        <div className="strength_string">{this.state.strength}</div>
                    </span>
                </label>
                <br/>
                <label className="password">Confirm Password
                    <input type={this.state.type} className="password__input" onChange={this.passwordStrength}/>
                </label>

            </form>
            <br/>
        </Modal.Body>
        <Modal.Footer>
            <Button onClick={this.submitPassword} disabled={this.state.isDisabled}>Submit</Button>
        </Modal.Footer>
    </Modal>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: regex for lowercase letters js 
Javascript :: react create root 
Javascript :: if json then parse 
Javascript :: tab navigation react-native without title 
Javascript :: shadowoffset react native constructor 
Javascript :: form confirm before submit 
Javascript :: req.body empty mongodb 
Javascript :: npx create react app Must use import to load ES Module error 
Javascript :: toobject() javascript 
Javascript :: match date regex 
Javascript :: node js request async await 
Javascript :: chrome extension communication between popup and content script 
Javascript :: how to encode a string in javascript 
Javascript :: how to remove header in react navigation 
Javascript :: how to concurrently run angular and node 
Javascript :: mongoose connect url 
Javascript :: even number function in javascript 
Javascript :: javascript object to json 
Javascript :: Get full year from date object 
Javascript :: js timestamp 
Javascript :: neo4j delete relationship nodes 
Javascript :: prompt node 
Javascript :: how to simulate a keypress in javascript 
Javascript :: how to creat a function 
Javascript :: javascript css left 
Javascript :: function redirect javascript 
Javascript :: jquery modal close 
Javascript :: datetime to date in js 
Javascript :: classlist remove all classes 
Javascript :: remove all spaces from string javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =